QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#343531#8230. SubmissionszzuqyWA 0ms3640kbC++143.4kb2024-03-02 18:14:072024-03-02 18:14:07

Judging History

你现在查看的是最新测评结果

  • [2024-05-20 23:50:57]
  • hack成功,自动添加数据
  • (/hack/623)
  • [2024-05-20 23:48:44]
  • hack成功,自动添加数据
  • (/hack/622)
  • [2024-03-02 18:14:07]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3640kb
  • [2024-03-02 18:14:07]
  • 提交

answer

#include <bits/stdc++.h>

struct Submission {
	int ac;
	int dirt;
};

struct Data {
	int num, dirt;
	int gold, yes;
	std::vector<Submission> t[26];
} a;
std::map<std::string, Data> map;

inline int getGoldNum(int num) {
	return std::min((int)((num + 9) * 0.1), 35);
}
std::pair<int, int>tmp[100006];

int main() {
	int m;
	scanf("%d", &m);
	std::string name, status;
	char t;
	int dirt;
	for (int i = 1; i <= m; i++) {
		std::cin >> name >> t >> dirt >> status;
		if (map.find(name) == map.end())
			map[name] = a;
		map[name].t[t - 'A'].push_back((Submission) {
			status[0] == 'a', dirt
		});
	}
	int cnt = 0, num = 0;
	for (std::pair<std::string, Data> a : map) {
		tmp[++cnt] = std::make_pair(a.second.num, -a.second.dirt);
		if (a.second.num)
			num++;
	}
	int goldCnt = getGoldNum(num);
	std::sort(tmp + 1, tmp + 1 + cnt);
	int goldNum, goldDirt, silverNum, silverDirt;
	goldNum = tmp[goldCnt].first;
	goldDirt = -tmp[goldCnt].second;
	silverNum = tmp[goldCnt + 1].first;
	silverDirt = -tmp[goldCnt + 1].second;

	int ans = 0, silver = 0;
	for (std::pair<std::string, Data> a : map) {
		if (a.second.num > goldNum || (a.second.num == goldNum && a.second.dirt <= goldDirt)) {
			a.second.gold = 1;
		}

		if (a.second.num == 1 && getGoldNum(num) < getGoldNum(num + 1) && !silver) {
			for (int i = 0; i < 26; i++) {
				for (int o = 0; o < a.second.t[i].size(); o++)
					if (a.second.t[i][o].ac == 0) {
						silver = 1;
						break;
					}
			}
		}
		if (a.second.gold && !silver) {
			for (int i = 0; i < 26; i++) {
				int dirt = 0, ac = 0, o = 0;
				for (; o < a.second.t[i].size() && a.second.t[i][o].ac == 0; o++);
				if (o == a.second.t[i].size())
					continue;
				dirt -= a.second.t[i][o].dirt;
				int fuck = dirt;
				for (o++; o < a.second.t[i].size() && a.second.t[i][o].ac == 0; o++) {
					dirt += 20;
				}
				if (o != a.second.t[i].size()) {
					dirt += a.second.t[i][o].dirt;
					if (num == silverNum && a.second.dirt + dirt >= silverDirt) {
						silver = 1;
						break;
					}
				} else {
					dirt = fuck;
					if (a.second.num > 1 || getGoldNum(num - 1) == getGoldNum(num)) {
						if (a.second.num - 1 < silverNum || (a.second.num - 1 == silverNum && a.second.dirt + dirt >= silverDirt)) {
							silver = 1;
							break;
						}
					}
				}
			}
		}
		if (!a.second.gold && !a.second.yes) {
			if (a.second.dirt == silverDirt && a.second.num == silverNum && silver) {
				a.second.yes = 1;
				continue;
			}
			for (int i = 0; i < 26; i++) {
				if (a.second.t[i].size() == 0)
					continue;
				if (a.second.t[i][0].ac)
					continue;
				int dirt = 0, o = 0;
				for (; o < a.second.t[i].size() && a.second.t[i][o].ac == 0; o++)
					dirt -= 20;
				if (o == a.second.t[i].size()) {
					dirt = a.second.t[i][0].dirt;
					if (goldNum < a.second.num + 1 || (goldNum == a.second.num + 1 && a.second.dirt + dirt <= goldDirt)) {
						a.second.yes = 1;
						break;
					}
				}
				dirt -= a.second.t[i][o].dirt;
				dirt += a.second.t[i][0].dirt;
				if (goldNum < a.second.num + 1 || (goldNum == a.second.num + 1 && a.second.dirt + dirt <= goldDirt)) {
					a.second.yes = 1;
					break;
				}
			}
		}
		if (a.second.gold || a.second.yes)
			ans++;
	}
	std::cout << ans << '\n';
	for (std::pair<std::string, Data> a : map) {
		if (a.second.gold || a.second.yes) {
			std::cout << a.first << ' ';
		}
	}
	std::cout << '\n';
	return 0;
}

詳細信息

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3640kb

input:

2
5
TSxingxing10 G 0 rejected
TSxingxing10 B 83 accepted
aoliaoligeiliao J 98 accepted
TS1 J 118 accepted
TS1 B 263 accepted
12
AllWayTheNorth A 0 rejected
YaoYaoLingXian Y 10 accepted
XuejunXinyoudui1 X 200 rejected
XuejunXinyoudui1 X 200 accepted
LetItRot L 215 accepted
AllWayTheNorth W 250 accept...

output:

1


result:

wrong answer the numbers are different in the case 1. (test case 1)