比赛 EYOI与SBOI开学欢乐赛2nd 评测结果 WWWWW
题目名称 个人所得税 最终得分 0
用户昵称 湖岸与夜与咸鱼 运行时间 0.024 s
代码语言 C++ 内存使用 2.67 MiB
提交时间 2022-09-02 21:32:08
显示代码纯文本
// 河南省实验中学 高中 21级 关天泽

#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define re register

const int N = 0x3f3f3f;
using namespace std;

long long month_money[50050][20];
double shui; 
int m;

double linshui(int mmoney){
	double thisshui = 0;
	double money = mmoney;
	if (money <= 4000) money -= 800;
	else money = money * 4 / 5;
	if (money <= 20000){
		thisshui += money / 5;
		return thisshui;
	}
	if (money <= 50000){
		thisshui += 4000;
		money -= 20000;
		thisshui += money * 3 / 10;
		return thisshui;
	}
	
	thisshui += 13000;
	money -= 50000;
	thisshui += money * 2 / 5;
	return thisshui;
}

double geshui(int mmoney){
	double thisshui = 0;
	double money = mmoney;
	if (money <= 500){
		thisshui += money / 20;
		return thisshui;
	}
	thisshui += 25;
	if (money <= 2000){
		money -= 500;
		thisshui += money / 10;
		return thisshui;
	}
	thisshui += 150;
	if (money <= 5000){
		money -= 2000;
		thisshui += money * 3 / 20;
		return thisshui;
	}
	thisshui += 450;
	if (money <= 20000){
		money -= 5000;
		thisshui += money / 5;
		return thisshui;
	}
	thisshui += 3000;
	if (money <= 40000){
		money -= 20000;
		thisshui += money / 4;
		return thisshui;
	}
	thisshui += 5000;
	if (money <= 60000){
		money -= 40000;
		thisshui += money * 3 / 10;
		return thisshui;
	}
	thisshui += 6000;
	if (money <= 80000){
		money -= 60000;
		thisshui += money * 7 / 20;
		return thisshui;
	}
	thisshui += 7000;
	if (money <= 100000){
		money -= 80000;
		thisshui += money * 2 / 5;
		return thisshui;
	}
	thisshui += 8000;
	thisshui += money * 9 / 20;
	return thisshui;
}

int main(){
	freopen("personaltax.in", "r", stdin);
	freopen("personaltax.out", "w", stdout);
	cout << setiosflags(ios::fixed) << setprecision(2);
	cin >> m;
	for (;;){
		string lin;
		cin >> lin;
		char lins;
		int month, day, money, who;
		if (lin == "#") break;
		if (lin == "PAY"){
			cin >> who >> month >> lins >> day >> money;
			month_money[who][month] += money;
			continue;
		}
		else{
			cin >> who >> month >> lins >> day >> money;
			shui += linshui(money);
			cout << linshui(money) << endl;
			continue;
		}
	}
	for (int i = 1; i <= m; i++){
		for (int j = 1; j <= 12; j++){
			if (month_money[i][j] <= 800) continue;
			month_money[i][j] -= 800;
			shui += geshui(month_money[i][j]);
			cout << month_money[i][j] << " " << geshui(month_money[i][j]) << endl;
		}
	}
	cout << shui;
	return 0;
}