QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#567863 | #9308. World Cup | wangf_916 | WA | 0ms | 3540kb | C++20 | 939b | 2024-09-16 14:18:04 | 2024-09-16 14:18:04 |
Judging History
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;
struct AAA
{
string s1;
char s2;
string s3;
};
void solve() {
int n;
cin >> n;
map<pair<string, char>, int> mp;
map<char, int> mp2;
int mx = -1;
char ans = 'A';
vector<AAA> vec(n);
for (int i = 0; i < n; i ++) {
cin >> vec[i].s1 >> vec[i].s2 >> vec[i].s3;
if(vec[i].s3 == "accepted") {
pair<string, char> z;
z.first = vec[i].s1;
z.second = vec[i].s2;
mp[z] ++;
if(mp[z] == 1) {
mp2[vec[i].s2] ++;
if(mp2[vec[i].s2] >= mx) {
if(vec[i].s2 < ans) {
ans = vec[i].s2;
}
}
}
}
}
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: 0
Wrong Answer
time: 0ms
memory: 3540kb
input:
1 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
output:
A
result:
wrong output format Expected integer, but "A" found