QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#579819 | #9320. Find the Easiest Problem | autu_rain# | WA | 8ms | 3560kb | C++14 | 846b | 2024-09-21 18:10:58 | 2024-09-21 18:10:58 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef long long i64;
typedef __int128 i128;
typedef pair<int, int> pII;
#define x first
#define y second
const int N = 2e5 + 10, M = 1e6 + 10, mod = 998244353;
int t, n, m, a[N], b[N];
pII c[N];
void solve() {
cin >> n;
unordered_map<char, int> p;
set<string> s[26];
for (int i = 0; i < n; i ++ ) {
string a, c;
char b;
cin >> a >> b >> c;
if (s[b - 'A'].count(a) || c != "accepted") continue;
p[b] ++; s[b - 'A'].insert(a);
}
char ans = 'Z';
int mx = 0;
for (auto e : p)
if (e.second >= mx) {
mx = e.second;
ans = min(e.first, ans);
}
cout << ans << endl;
}
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr); cout.tie(nullptr);
cin >> t;
//t = 1;
while (t -- ) solve();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3536kb
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: 8ms
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:
A C B I A I A D D C D B F B A C B A A C A B I A A N A B A A F A D B B G B E A A C D A C D D H A A O J E A B D E B C C A E A D A B B H F A G C G E E A A E A B H A B B C A A F C G C C H C G C L A G D D C A F B A D I A A B H B E B A A B B B C E A E B B K C A G D D I I B A C D F B N A A C D A F B A B H ...
result:
wrong answer 1st lines differ - expected: 'Z', found: 'A'