CCF-CSP-2016-12-2工资计算

链接:http://118.190.20.162/view.page?gpid=T51

代码:

#include<bits/stdc++.h>

using namespace std;
int check(int x){
    int a=x-3500;
    int  ans=0;
    ans+=max(0,min(a,1500)*3/100);
    ans+=max(0,(min(4500,a)-1500)*10/100);
    ans+=max(0,(min(9000,a)-4500)*20/100);
    ans+=max(0,(min(35000,a)-9000)*25/100);
    ans+=max(0,(min(55000,a)-35000)*30/100);
    ans+=max(0,(min(80000,a)-55000)*35/100);
    ans+=max(0,(a-80000)*45/100);
    return ans;
}
int main (){
    int num;
    cin>>num;
    for(int i=0;i<=(int)1e5;i+=100){
        //cout<<check(i)<<endl;
        if(check(i)+num==i){

            cout<<i;
            return 0;
        }
    }
    return 0;
}

上一篇:CCF推荐会议/期刊目录(2019)


下一篇:CCF-CSP-2016-04-2俄罗斯方块