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 |
---|---|---|---|---|---|---|---|---|---|
#576963 | #9320. Find the Easiest Problem | susuland | RE | 1ms | 3624kb | C++14 | 559b | 2024-09-19 23:36:19 | 2024-09-19 23:36:19 |
Judging History
answer
#include<iostream>
#include<set>
using namespace std;
string team,res;
set<string> count[50];
char prob;
int main()
{
int t,n;
cin>>t;
while(t--){
cin>>n;
for(int i=1;i<=n;i++){
cin>>team>>prob>>res;
if(res=="accepted"){
count[prob-'A'].insert(team);
}
}
int ans=0;
for(int i=1;i<=n;i++){
if(count[ans].size()<count[i].size()){
ans=i;
}
}
cout<<char(ans+'A')<<endl;
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3624kb
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
Runtime Error
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 P