QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#568861#9320. Find the Easiest Problemzhr05WA 0ms3624kbC++20553b2024-09-16 18:57:032024-09-16 18:57:03

Judging History

你现在查看的是最新测评结果

  • [2024-09-16 18:57:03]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3624kb
  • [2024-09-16 18:57:03]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
int T,N,mx,num[30];
char ans;
string name,prob,resu;
unordered_map<char, unordered_set<string> >M;

signed main(){
	for(cin>>T;T;T--){
		cin>>N;
		ans='A',mx=0,M.clear(),fill(num,num+28,0);
		for(int i=1;i<=N;i++) {
			cin>>name>>prob>>resu;
			if(resu=="rejected") continue;
			if(M[prob[0]].find(name)==M[prob[0]].end()) num[prob[0]-'A']++;
			else M[prob[0]].insert(name);
			
			if(num[prob[0]-'A']>mx) mx=num[prob[0]-'A'],ans=prob[0];
					
		}
		cout<<ans<<'\n';
	}
	return 0;
} 

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 0ms
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
B

result:

wrong answer 2nd lines differ - expected: 'A', found: 'B'