QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#567007#9320. Find the Easiest ProblemLam017WA 12ms3820kbC++23849b2024-09-16 05:02:192024-09-16 05:02:19

Judging History

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

  • [2024-09-16 05:02:19]
  • 评测
  • 测评结果:WA
  • 用时:12ms
  • 内存:3820kb
  • [2024-09-16 05:02:19]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int t;
    cin >> t;
    int cnt[26];  
    while (t--) {
        int n;
        cin >> n;
        memset(cnt, 0, sizeof(cnt));
        map<string, string> mp;
        map<string, string> p;
        while (n--) {
            string s1, s2, s3;
            cin >> s1 >> s2 >> s3;
            if (s3[0] == 'r' || mp[s1] == s2 || p[s2] == s1)
                continue;
            mp[s1] = s2;
            p[s2] = s1;
            cnt[s2[0] - 'A']++; 
        }
        int mx = -1;
        char ans;
        for (int i = 0; i < 26; i++) {  
            if (cnt[i] > mx) {
                mx = cnt[i];
                ans = i + 'A';
            }
        }
        cout << ans << endl;
    }
    return 0;
}

详细

Test #1:

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

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: 12ms
memory: 3608kb

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
P
A
B
I
A
A
N
A
B
A
O
S
O
R
D
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
O
G
O
I
E
M
A
A
E
A
K
J
J
S
E
W
Z
K
F
I
S
P
M
H
G
G
H
W
I
P
D
D
O
A
F
N
C
S
Y
Z
S
G
D
F
Q
F
O
C
B
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'