QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#569490#9320. Find the Easiest Problemwangf_916WA 22ms3820kbC++20953b2024-09-16 23:36:212024-09-16 23:36:21

Judging History

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

  • [2024-09-16 23:36:21]
  • 评测
  • 测评结果:WA
  • 用时:22ms
  • 内存:3820kb
  • [2024-09-16 23:36:21]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

#define PII pair<int,int>
#define pb push_back
#define all(x) (x).begin(), (x).end()

using ll = long long;
using ull = unsigned long long;

void solve() {
    int n;
    cin >> n;
    map<pair<string,char>, int> mp;
    string s1, s2;
    char c;
    while(n--) {
        cin >> s1 >> c >> s2;
        if(s2 == "accepted") {
            mp[{s1, c}] ++;
        }
    }   
    char ans = 0;
    int mx = -1;
    map<char, int> mp2;
    for (char i = 'A'; i <= 'Z'; i ++) {
        for (auto [x,y] : mp) {
            mp2[x.second] ++;
            if(mp2[x.second] > mx) {
                ans = x.second;
                mx = mp2[x.second];
            }
        }
    }
    cout << ans << '\n';
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int tt;
    cin >> tt;
    while (tt--) {
        solve();    
    }

    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

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: 22ms
memory: 3572kb

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

result:

wrong answer 9th lines differ - expected: 'S', found: 'T'