QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#632192#9320. Find the Easiest Problemchie4#WA 31ms3592kbC++141.0kb2024-10-12 12:52:502024-10-12 12:52:50

Judging History

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

  • [2024-10-12 12:52:50]
  • 评测
  • 测评结果:WA
  • 用时:31ms
  • 内存:3592kb
  • [2024-10-12 12:52:50]
  • 提交

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'