QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#566946#9320. Find the Easiest ProblemLam017WA 6ms3560kbC++20904b2024-09-16 04:06:442024-09-16 04:06:45

Judging History

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

  • [2024-09-16 04:06:45]
  • 评测
  • 测评结果:WA
  • 用时:6ms
  • 内存:3560kb
  • [2024-09-16 04:06:44]
  • 提交

answer

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

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

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: 6ms
memory: 3560kb

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:

Y
D
G
N
A
H
F
G
S
J
I
H
E
Q
Y
B
D
X
H
U
H
I
H
G
C
M
D
J
E
N
E
N
E
N
C
F
J
D
R
A
E
C
P
B
C
G
N
O
J
N
I
D
D
T
T
D
I
S
K
F
W
H
D
B
F
D
P
E
F
F
I
H
E
G
A
F
D
A
V
G
G
O
D
I
C
J
H
G
F
J
L
F
K
G
G
E
H
O
S
I
N
O
E
H
W
R
X
Y
C
O
V
I
P
E
O
V
G
Q
T
A
N
G
H
I
O
R
B
Q
I
C
C
A
F
P
K
L
W
Q
G
T
I
Y
C
J
F
O
J
D
A
G
...

result:

wrong answer 1st lines differ - expected: 'Z', found: 'Y'