QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#566994 | #9320. Find the Easiest Problem | Lam017 | WA | 8ms | 3852kb | C++23 | 974b | 2024-09-16 04:51:44 | 2024-09-16 04:51:45 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int t;
cin >> t;
while (t--) {
int n;
cin >> n;
int cnt[26] = {0};
map<string, string> mp;
for (int i = 0; i < n; i++) {
string team, problem, result;
cin >> team >> problem >> result;
if (result[0] == 'r' || mp[team] == problem)
continue;
mp[team] = problem;
cnt[problem[0] - 'A']++;
}
int maxSolvedTeams = -1;
char easiestProblem = 'Z' + 1;
for (int i = 0; i < 26; i++) {
if (cnt[i] > maxSolvedTeams || (cnt[i] == maxSolvedTeams && (i + 'A') < easiestProblem)) {
maxSolvedTeams = cnt[i];
easiestProblem = i + 'A';
}
}
cout << easiestProblem << endl;
}
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3852kb
input:
2 5 teamA A accepted teamB B rejected teamC A accepted teamB B accepted teamD C accepted 4 teamA A rejected teamB A accepted teamC B accepted teamC B accepted
output:
A A
result:
ok 2 lines
Test #2:
score: -100
Wrong Answer
time: 8ms
memory: 3604kb
input:
1000 44 WaiooyIXa O accepted WaiooyIXa P accepted ZYYsNWag P accepted DPIawQg D rejected IzPdjnM Z rejected Ra D rejected kwQyGxLo I rejected DPIawQg L accepted kwQyGxLo I accepted mmWxDuADCB D rejected PXwVAOgwiz P rejected ZYYsNWag U accepted IzPdjnM Z accepted TgBNO P rejected kwQyGxLo J accepted...
output:
Z E Z I B I G H S K J I H R Z C K F I D A B I A A N A B A O S O R C H G K E S D F D R C U V W P F O J E A B U M C T B G V A Z N E O Q F O G O I E O A U E A K J J S E W Z K F I S P O H G G H W I P D D O P F N C L Y Z S G D F Q F O C O B U C I A E I P K C R X N D N L Q L I X I H U J Z F K G F N F B H ...
result:
wrong answer 18th lines differ - expected: 'O', found: 'F'