QOJ.ac
QOJ
The 2nd Universal Cup Finals is coming! Check out our event page, schedule, and competition rules!
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#566863 | #9320. Find the Easiest Problem | rlaaa | TL | 0ms | 0kb | C++23 | 915b | 2024-09-16 02:37:04 | 2024-09-16 02:37:04 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
unordered_map <string, int> mp;//队名
unordered_map <char,int> co;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int t;
cin >> t;
while (t--) {
co.clear();mp.clear();
int k;
cin >> k;
for (int i = 0; i < k; k++) {
string team, answer;
char qus;
cin >> team >> qus >> answer;
if (answer == "accepted") {
if (mp[team] >>(qus-'A') &1) continue;
mp[team]|=1<<(qus-'A');
co[qus]++;
}
}
int maxx = -1;char maxname;
for(auto &ele:co){
if(maxx<ele.second ||(maxx==ele.second && maxname<ele.first)) {
maxx=ele.second;maxname=ele.first;
}
}
cout<<maxname<<'\n';
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Time Limit Exceeded
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