QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#566906 | #9320. Find the Easiest Problem | Kidding_Ma | RE | 0ms | 0kb | C++17 | 876b | 2024-09-16 03:08:13 | 2024-09-16 03:08:13 |
answer
#include "bits/stdc++.h"
using namespace std;
using i64 = int64_t;
using ll = long long;
void solve() {
int n;
cin >> n;
vector<vector<string>> a;
for (int i = 0; i < n; i++) {
string name, res;
char id;
cin >> name >> id >> res;
if (res == "accepted") {
a[id - 'A'].push_back(name);
}
}
int ans;
int mx = 0;
for (int i = 0; i < 26; i++) {
sort(a[i].begin(), a[i].end());
a[i].erase(unique(a[i].begin(), a[i].end()), a[i].end());
if (a[i].size() > mx) {
mx = a[i].size();
ans = i;
}
}
cout << char(ans + 'A') << '\n';
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int t;
cin >> t;
while (t--) {
solve();
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Runtime Error
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