QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#570121#9320. Find the Easiest ProblemAceTaffy258WA 0ms3616kbC++20723b2024-09-17 13:59:342024-09-17 13:59:39

Judging History

This is the latest submission verdict.

  • [2024-09-17 13:59:39]
  • Judged
  • Verdict: WA
  • Time: 0ms
  • Memory: 3616kb
  • [2024-09-17 13:59:34]
  • Submitted

answer

#include<bits/stdc++.h>
using namespace std;

int n,m;
int ac[100005][30];
char ques_id;
string team_name,isac;
int main(){
	std::ios::sync_with_stdio(0);
	cin.tie(0),cout.tie(0);
	int T;cin>>T;
	while(T--){
		cin>>n;
		map<string,int> idx;
		int cnt=0;
		for(int i=1;i<=n;i++){
			for(int j=0;j<26;j++){
				ac[i][j]=0;
			}
		}
		int ans=0;char ANS;
		for(int i=1;i<=n;i++){
			cin>>team_name>>ques_id>>isac;
			if(!idx[team_name]){
				idx[team_name]=(++cnt);
			}
			if(isac=="accepted"){
				ac[idx[team_name]][ques_id-'A']++;
				if(ac[idx[team_name]][ques_id-'A']>ans){
					ans=ac[idx[team_name]][ques_id-'A'];
					ANS=ques_id;
				}
			}
		}
		cout<<ANS<<endl;
	}
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

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'