QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#632192 | #9320. Find the Easiest Problem | chie4# | WA | 31ms | 3592kb | C++14 | 1.0kb | 2024-10-12 12:52:50 | 2024-10-12 12:52:50 |
Judging History
answer
#include <algorithm>
#include <iostream>
#include <map>
#include <ostream>
#include <set>
#include <string>
int main() {
int t, n;
char problem_id;
std::string team_name;
std::string submission_status;
std::map<char, std::set<std::string>> m;
std::cin >> t;
char ans[t];
for (int i = 0; i < t; i++) {
std::cin >> n;
for (int j = 0; j < n; j++) {
std::cin >> team_name >> problem_id >> submission_status;
if (submission_status[0] == 'a') {
m[problem_id].insert(team_name);
}
}
ans[i] =
std::max_element(
m.begin(), m.end(),
[](const std::pair<char, std::set<std::string>> &a,
const std::pair<char, std::set<std::string>> &b) -> bool {
return a.second.size() < b.second.size();
})
->first;
}
for (int i = 0; i < t; i++) {
std::cout << ans[i] << std::endl;
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3592kb
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: 31ms
memory: 3504kb
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 P P H H H Z H H H H H H H H H J F F D D D D D 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 2nd lines differ - expected: 'E', found: 'P'