QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#574827#9320. Find the Easiest ProblemwinterlWA 1ms4020kbC++201.3kb2024-09-19 01:07:322024-09-19 01:07:32

Judging History

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

  • [2024-09-19 01:07:32]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:4020kb
  • [2024-09-19 01:07:32]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
map<string, int> m;

auto solve() {
    int n;
    cin >> n;
    vector a(27, 0);
    vector vis(n + 5, vector(27, false));
    // index_of_range
    int j = 1;
    for (int i = 1; i <= n; i++) {
        string s1, s2;
        char zm;
        cin >> s1;
        cin >> zm;
        cin >> s2;
        if (!m.contains(s1)) {
            m[s1] = j++;
        }
        try {
            if (!vis.at(m[s1]).at(zm - 'A' + 1) and s2 == "accepted") {
                a[zm - 'A' + 1]++;
                vis.at(m[s1]).at(zm - 'A' + 1) = true;
            }
        } catch (...) {
            cout << '(' << n << ") - ([" << s1 << "]) - " << '[' << m[s1] << "] - [(" << vis.size() << ")]\n";
            for(auto &&[key, value] : m) {
                cout << '[' << key << ',' << value << ']' << '\n';
            }
            exit(0);
        }
    }
    int ans = 0, ans_i = 0;
    for (int i = 1; i <= 26; i++) {
        if (a[i] > ans) {
            ans = a[i];
            ans_i = i;
        }
    }
    cout << char(ans_i + 64) << endl;
}

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int64_t t;
    cin >> t;
    while (t--)
        solve();
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3576kb

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: 1ms
memory: 4020kb

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
O
I
P
A
B
I
A
A
N
A
B
A
O
F
O
R
T
H
G
K
E
S
D
F
D
R
C
U
V
W
P
A
O
J
E
A
B
U
M
C
T
L
G
V
A
Z
N
E
O
Q
F
B
(4) - ([TgBNO]) - [9] - [(9)]
[DPIawQg,3]
[IzPdjnM,4]
[PXwVAOgwiz,8]
[Ra,5]
[TgBNO,9]
[WaiooyIXa,1]
[ZYYsNWag,2]
[fIXHPcZCV,10]
[kwQyGxLo,6]
[mmWxDuADCB,7]

result:

wrong answer 70th lines differ - expected: 'G', found: '(4) - ([TgBNO]) - [9] - [(9)]'