QOJ.ac
QOJ
The 2nd Universal Cup Finals is coming! Check out our event page, schedule, and competition rules!
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#570301 | #9320. Find the Easiest Problem | xxfei | WA | 17ms | 3588kb | C++20 | 1.0kb | 2024-09-17 15:14:57 | 2024-09-17 15:15:01 |
Judging History
answer
#include <iostream>
#include <map>
#include <vector>
using namespace std;
struct question {
map<string, bool> team;
int sum = 0;
};
int main() {
int t;
cin >> t;
while (t--) {
int n;
cin >> n;
string team_name, answer;
char question_char;
vector<question> qt(26); // 26个字母对应的问题
for (int i = 0; i < n; ++i) {
cin >> team_name >> question_char >> answer;
if (answer == "accepted") {
int k = question_char - 'A';
if (qt[k].team.find(team_name) == qt[k].team.end()) {
qt[k].team[team_name] = true;
}
}
}
int max_sum = 0;
char result = 'A';
for (int i = 0; i < 26; ++i) {
if (qt[i].sum > max_sum) {
max_sum = qt[i].sum;
result = i + 'A';
}
}
cout << result << endl;
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3468kb
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: 17ms
memory: 3588kb
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:
A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A ...
result:
wrong answer 1st lines differ - expected: 'Z', found: 'A'