比赛 |
EYOI与SBOI开学欢乐赛2nd |
评测结果 |
AAAAA |
题目名称 |
个人所得税 |
最终得分 |
100 |
用户昵称 |
op_组撒头屯 |
运行时间 |
0.000 s |
代码语言 |
C++ |
内存使用 |
0.00 MiB |
提交时间 |
2022-09-02 21:21:20 |
显示代码纯文本
#include <bits/stdc++.h>
using namespace std;
typedef long double ld;
const int M=50000+5;
int m;
ld tot[M][14]={0};
ld ans=0;
void calc(ld x,ld lw,ld tp,ld per){
if (x<=lw)return ;
ld num=min(x,tp)-lw;
ans+=per/100*num;
return ;
}
int main(){
freopen ("personaltax.in","r",stdin);
freopen ("personaltax.out","w",stdout);
scanf("%d",&m);
while(true){
char s[10];int id;ld x;
scanf("%s",s);
if (s[0]=='#')break;
if (s[0]=='P'){
scanf("%d%s%Lf",&id,s,&x);
int mth=s[0]-'0',mth2=s[1];
if (mth2!='/')mth=mth*10+mth2-'0';
tot[id][mth]+=x;
}
else{
scanf("%d%s%Lf",&id,s,&x);
if (x<=4000)x-=800;
else x=x*4/5;
calc(x,0,20000,20);
calc(x,20000,50000,30);
calc(x,50000,1e6,40);
}
}
for (int i=1;i<=m;i++){
for (int j=1;j<=12;j++){
if (tot[i][j]==0)continue;
tot[i][j]-=800;
calc(tot[i][j],0,500,5);
calc(tot[i][j],500,2000,10);
calc(tot[i][j],2000,5000,15);
calc(tot[i][j],5000,20000,20);
calc(tot[i][j],20000,40000,25);
calc(tot[i][j],40000,60000,30);
calc(tot[i][j],60000,80000,35);
calc(tot[i][j],80000,100000,40);
calc(tot[i][j],100000,1e9,45);
}
}
printf("%.2Lf\n",ans);
return 0;
}