QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#567980#9320. Find the Easiest ProblemYueen#WA 0ms3628kbC++14479b2024-09-16 14:52:332024-09-16 14:52:35

Judging History

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

  • [2024-09-16 14:52:35]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3628kb
  • [2024-09-16 14:52:33]
  • 提交

answer

#include<iostream>
#include<string>
#include<map>
using namespace std;
map<char,int>m;
int main(){
	int t;
	cin>>t;
	while(t--){
		int n;
		cin>>n;
		string d,r;
		char t,chmax;
		for(int i=0;i<n;i++){
			cin>>d>>t>>r;
			if(r[0]=='a') m[t]++;
		}
		int max=0;
		map<char,int>::iterator it=m.begin();
		for(;it!=m.end();it++){
			if(it->second>max){
				max=it->second;
				chmax=it->first;
			}
		}
		cout<<chmax<<endl;
		m.clear();
	}
	return 0;
} 

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3628kb

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'