QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#573470 | #9320. Find the Easiest Problem | yasdf123 | RE | 0ms | 0kb | C++20 | 459b | 2024-09-18 18:55:00 | 2024-09-18 18:55:13 |
answer
#include<bits/stdc++.h>
using namespace std;
int run(){
int n;
cin>>n;
map<string,map<string,int>> s;
int an=0;
char ans='Z';
for(int i=0;i<n;i++){
string x[3];
cin>>x[0]>>x[1]>>x[2];
if(x[2]=="accepted"){
s[x[1]][x[0]]=1;
if((s[x[1]].size()>an)||((s[x[1]].size()==an)&&(x[1][0]<ans))){
an=s[x[1]].size();
ans=x[1][0];
}
}
}
cout<<ans<<"\n";
}
int main(){
int t;
cin>>t;
while(t--){
run();
}
}
详细
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