比赛 EYOI与SBOI开学欢乐赛2nd 评测结果 AAAAA
题目名称 个人所得税 最终得分 100
用户昵称 遥时_彼方 运行时间 0.000 s
代码语言 C++ 内存使用 0.00 MiB
提交时间 2022-09-02 20:20:27
显示代码纯文本
#include<bits/stdc++.h>
#define rep(x,y,z) for(int x=y;x<=z;x++)
#define drep(x,y,z) for(int x=y;x>=z;x--)
#define ull unsigned long long
#define ll long long
using namespace std;
inline int read()
{
	int x=0;bool flag=1;char ch=getchar();
	while(ch<'0'||ch>'9') {if(ch=='-')flag=0;ch=getchar();}
	while(ch>='0'&&ch<='9') {x=(x<<3)+(x<<1)+ch-'0';ch=getchar();}
	if(flag) return x;
	return ~(x-1);
} 
inline void write(int x)
{
	if(x<0) {x=~(x-1);putchar('-');}
	if(x>9) write(x/10);
	putchar(x%10+'0');
}
///////////////////////////////////////
const int M=5e4+50;
int nc; 
double a[M][13];
double ans;
inline void PAY(double x)
{
	x-=800;
	if(x>100000) ans+=29625+(x-100000)*0.45;
	else if(x>80000) ans+=21625+(x-80000)*0.40;
	else if(x>60000) ans+=14625+(x-60000)*0.35;
	else if(x>40000) ans+=8625+(x-40000)*0.30;
	else if(x>20000) ans+=3625+(x-20000)*0.25;
	else if(x>5000) ans+=625+(x-5000)*0.20;
	else if(x>2000) ans+=175+(x-2000)*0.15;
	else if(x>500) ans+=25+(x-500)*0.10;
	else if(x>0) ans+=x*0.05;
}
inline void INCOME(double x)
{
	if(x<=4000) x-=800;
	else x*=0.8;
	if(x>50000) ans+=13000+(x-50000)*0.40;
	else if(x>20000) ans+=4000+(x-20000)*0.30;
	else if(x>0) ans+=x*0.20;
}
int main()
{
    freopen("personaltax.in","r",stdin);
	freopen("personaltax.out","w",stdout);
	nc=read();
	string s1;
	int s2;
	double s3;
	char s4;
	int r1,r2;
	while(cin>>s1)
	{
		if(s1[0]=='#') break;
		s2=read();
		r1=read();
		r2=read();
		s3=read();
		if(s1[0]=='I') INCOME(s3);
		else a[s2][r1]+=s3;
	}
	rep(i,1,nc)
		rep(o,1,12) PAY(a[i][o]);
	printf("%.2lf\n",ans);
    return 0;
}
/*
PAY:
>500:25
>2000:175
>5000:625
>20000:3625
>40000:8625
>60000:14625
>80000:21625
>100000:29625

INCOME:
>20000:4000
>50000:13000
*/