记录编号 |
575073 |
评测结果 |
AAAAA |
题目名称 |
[NOI 1998]个人所得税 |
最终得分 |
100 |
用户昵称 |
JasonW6 |
是否通过 |
通过 |
代码语言 |
C++ |
运行时间 |
0.000 s |
提交时间 |
2022-09-02 22:10:36 |
内存使用 |
0.00 MiB |
显示代码纯文本
#include<bits/stdc++.h>
using namespace std;
int m,p1,p2;
double ans,n1,n2,np[50005][15];
char c1[10],c2[10];
void clenc(){
c1[0]=0,c1[1]=0,c1[2]=0,c1[3]=0,c1[4]=0,c1[5]=0,c1[6]=0,c1[7]=0,c1[8]=0,c1[9]=0;
}
int main(){
freopen("personaltax.in","r",stdin);
freopen("personaltax.out","w",stdout);
cin>>m;
while(cin>>c1){
cin>>p1,cin>>p2,cin>>c2;
cin>>n1;
if(c1[0]=='P'&&c1[1]=='A'&&c1[2]=='Y') {
np[p1][p2]+=n1;
}
if(c1[0]=='I'&&c1[1]=='N'&&c1[2]=='C'&&c1[3]=='O'&&c1[4]=='M'&&c1[5]=='E'){
if(n1<=800) continue;
if(n1<=4000) n1-=800;
else n1=n1-n1*0.2;
if(n1<=20000) {
ans+=n1*0.2;
continue;
}
if(n1>20000) ans+=20000*0.2;
if(n1<=50000) {
ans+=(n1-20000)*0.3;
continue;
}
if(n1>50000) {
ans+=30000*0.3;
ans+=(n1-50000)*0.4;
}
}
clenc();
}
for(int i=1;i<=m;i++){
for(int j=1;j<=12;j++){
n1=np[i][j];
if(n1<=800) continue;
else n1-=800;
if(n1<=500){
ans+=n1*0.05;
continue;
}
if(n1>500){
ans+=500*0.05;
}
if(n1<=2000){
ans+=(n1-500)*0.1;
continue;
}
if(n1>2000){
ans+=1500*0.1;
}
if(n1<=5000){
ans+=(n1-2000)*0.15;
continue;
}
if(n1>5000){
ans+=3000*0.15;
}
if(n1<=20000){
ans+=(n1-5000)*0.2;
continue;
}
if(n1>20000){
ans+=15000*0.2;
}
if(n1<=40000){
ans+=(n1-20000)*0.25;
continue;
}
if(n1>40000){
ans+=20000*0.25;
}
if(n1<=60000){
ans+=(n1-40000)*0.3;
continue;
}
if(n1>60000){
ans+=20000*0.3;
}
if(n1<=80000){
ans+=(n1-60000)*0.35;
continue;
}
if(n1>80000){
ans+=20000*0.35;
}
if(n1<=100000){
ans+=(n1-80000)*0.4;
continue;
}
if(n1>100000){
ans+=20000*0.4;
ans+=(n1-100000)*0.45;
continue;
}
}
}
cout<<setprecision(2)<<std::fixed<<ans;
return 0;
}