比赛 EYOI与SBOI开学欢乐赛2nd 评测结果 AAAAA
题目名称 个人所得税 最终得分 100
用户昵称 该账号已注销 运行时间 0.000 s
代码语言 C++ 内存使用 0.00 MiB
提交时间 2022-09-02 21:29:43
显示代码纯文本
#include<bits/stdc++.h>
using namespace std;
int m,mn[50010][14];
char a;
string s;
long double ans=0;
long double jsic(int x,int k){
    long double u=0;
    u=x;
    if(k==2){
    if(u>=800&&u<=4000)u-=800;
    else if(u<800)return 0;
    else if(u>4000)u-=u*0.2;
    if(u<=20000)return u*0.2;
    else if(u>20000&&u<=50000)return 4000+(u-20000)*0.3;
    else if(u>50000)return 4000+9000+(u-50000)*0.4;
    }
    if(k==1){
    if(u<800)return 0;
    else u-=800;
    if(u<=500)return u*0.05;
    if(u>500&&u<=2000)return 500*0.05+(u-500)*0.1;
    if(u>2000&&u<=5000)return 500*0.05+1500*0.1+(u-2000)*0.15;
    if(u>5000&&u<=20000)return 500*0.05+1500*0.1+3000*0.15+(u-5000)*0.2;
    if(u>20000&&u<=40000)return 500*0.05+1500*0.1+3000*0.15+15000*0.2+(u-20000)*0.25;
    if(u>40000&&u<=60000)return 500*0.05+1500*0.1+3000*0.15+15000*0.2+20000*0.25+(u-40000)*0.3;
    if(u>60000&&u<=80000)return 500*0.05+1500*0.1+3000*0.15+15000*0.2+20000*0.25+20000*0.3+(u-60000)*0.35;
    if(u>80000&&u<=100000)return 500*0.05+1500*0.1+3000*0.15+15000*0.2+20000*0.25+20000*0.3+20000*0.35+(u-80000)*0.4;
    if(u>100000)return 500*0.05+1500*0.1+3000*0.15+15000*0.2+20000*0.25+20000*0.3+20000*0.35+20000*0.4+(u-100000)*0.45;}
}
int main(){
    freopen("personaltax.in","r",stdin);
    freopen("personaltax.out","w",stdout);
    cin>>m;
    while(1){
        cin>>s;
        if(s[0]=='#')break;
        int x,mt,dt,ic;
        scanf("%d%d",&x,&mt);
        cin>>a;
        scanf("%d%d",&dt,&ic);
        if(s[0]=='P')mn[x][mt]+=ic;
        else ans+=jsic(ic,2);
    }
    for(int i=1;i<=12;i++){
        for(int j=1;j<=m;j++){
            ans+=jsic(mn[j][i],1);
        }
    }
    printf("%.2Lf",ans);
    return 0;
}