QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#343531 | #8230. Submissions | zzuqy | WA | 0ms | 3640kb | C++14 | 3.4kb | 2024-03-02 18:14:07 | 2024-03-02 18:14:07 |
Judging History
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)