文章

54

粉丝

66

获赞

54

访问

3.6k

头像
利润提成 题解:
P1040 北京大学机试题
发布于2024年4月22日 18:14
阅读数 87

#include<bits/stdc++.h>
using namespace std;
typedef long long LL;

const int N = 1e5;
LL x, ans; 

int main()
{
	cin >> x;
	
	if(x <= N) ans = x * 0.1;
	else if(x <= N * 2)
		ans = N * 0.1 + (x - N) * 0.075; 
	else if(x <= N * 4)
		ans = N * 0.1 + N * 0.075 + (x - 2 * N) * 0.05;
	else if(x <= N * 6)
		ans = N * 0.1 + N * 0.075 + 2 * N * 0.05 + (x - 4 * N) * 0.03;
	else if(x <= N * 10)
		ans = N * 0.1 + N * 0.075 + 2 * N * 0.05 + 2 * N * 0.03 + (x - 6 * N) * 0.015;
	else 
		ans = N * 0.1 + N * 0.075 + 2 * N * 0.05 + 2 * N * 0.03 + 4 * N * 0.015 + (x - 10 * N) * 0.01;
	
	cout << ans;
	return 0;	
}

 

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发