比赛 |
EYOI与SBOI开学欢乐赛2nd |
评测结果 |
AWWWW |
题目名称 |
个人所得税 |
最终得分 |
20 |
用户昵称 |
惠惠 |
运行时间 |
0.000 s |
代码语言 |
C++ |
内存使用 |
0.00 MiB |
提交时间 |
2022-09-02 21:19:57 |
显示代码纯文本
#include <bits/stdc++.h>
using namespace std;
long long M, pay[50010][15] = {0};
double tax[50010] = {0}, ans = 0;
string mode;
int main()
{
freopen("personaltax.in", "r", stdin);
freopen("personaltax.out", "w", stdout);
cin >> M;
while(cin >> mode)
{
if(mode[0] == '#') break;
if(mode[0] == 'P')
{
int number, money;
string date;
cin >> number >> date >> money;
pay[number][date[0] - '0'] += money;
continue;
}
if(mode[0] == 'I')
{
int number, money;
double tax_money;
string date;
cin >> number >> date >> money;
if(money <= 4000) tax_money = money - 800;
else tax_money = money * 0.8;
if(tax_money <= 0) continue;
if(tax_money <= 20000)
{
tax[number] += tax_money * 0.2;
continue;
}
if(tax_money <= 50000)
{
tax[number] += 4000 + (tax_money - 20000) * 0.3;
continue;
}
if(tax_money > 50000)
{
tax[number] += 13000 + (tax_money - 50000) * 0.4;
}
}
}
for(int i = 1; i <= M; ++i)
{
for(int j = 1; j <= 12; ++j)
{
int tax_money = pay[i][j] - 800;
if(tax_money <= 0) continue;
if(tax_money <= 500)
{
tax[i] += tax_money * 0.05;
continue;
}
if(tax_money <= 2000)
{
tax[i] += 25 + (tax_money - 500) * 0.1;
continue;
}
if(tax_money <= 5000)
{
tax[i] += 175 + (tax_money - 2000) * 0.15;
continue;
}
if(tax_money <= 20000)
{
tax[i] += 625 + (tax_money - 5000) * 0.2;
continue;
}
if(tax_money <= 40000)
{
tax[i] += 4625 + (tax_money - 20000) * 0.25;
continue;
}
if(tax_money <= 60000)
{
tax[i] += 9625 + (tax_money - 40000) * 0.3;
continue;
}
if(tax_money <= 80000)
{
tax[i] += 15625 + (tax_money - 60000) * 0.35;
continue;
}
if(tax_money <= 100000)
{
tax[i] += 22625 + (tax_money - 80000) * 0.4;
continue;
}
if(tax_money > 100000)
{
tax[i] += 30625 + (tax_money - 100000) * 0.45;
continue;
}
}
}
for(int i = 1; i <= M; ++i)
{
ans += tax[i];
}
cout << setiosflags(ios::fixed) << setprecision(2) << ans << endl;
return 0;
}