QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#576096 | #9320. Find the Easiest Problem | tzw | WA | 23ms | 3860kb | C++14 | 574b | 2024-09-19 18:24:20 | 2024-09-19 18:24:21 |
Judging History
answer
#include<iostream>
#include<map>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
map<pair<char,char>,int>mp1;
map<char,int>mp2;
int n;
cin>>n;
char ans='A';
int max=0;
for(int i=1;i<=n;i++){
string s1;
cin>>s1;
char id;
cin>>id;
string s2;
cin>>s2;
if(s2[0]=='r') continue;
if(mp1[{s1[4],id}]) continue;
mp2[id]++;
mp1[{s1[4],id}]++;
if(mp2[id]>max){
max=mp2[id];
ans=id;
}
else if(mp2[id]==max){
if(id<ans) ans=id;
}
}
cout<<ans<<endl;
}
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3860kb
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
Wrong Answer
time: 23ms
memory: 3564kb
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 E Z O B I G H T K J I H R Z C K O I P A B I A A N A B A O F O R T H G K E S D F D O C U V W P A O J E A B U M C T B Y V A O N E O H F B G J I E M A A E A K W J P E W Z K F I S P M H G G H W I P T D O A F N C L Y Z S G J F Q F O C B B U C I A E I P K C R X N D N L Q L I X I H U J Z D K G F T F B H ...
result:
wrong answer 4th lines differ - expected: 'I', found: 'O'