QOJ.ac

QOJ

IDSubmission IDProblemHackerOwnerResultSubmit timeJudge time
#871#576115#9320. Find the Easiest Problem3un_larryfuncAaFailed.2024-09-21 20:34:482024-09-21 20:34:48

Details

Extra Test:

Invalid Input

input:



output:


result:

FAIL Unexpected white-space - token expected (stdin, line 1)

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#576115#9320. Find the Easiest ProblemAa#AC ✓9ms5600kbC++14717b2024-09-19 18:31:282024-09-19 18:31:28

answer

#include <iostream>
#include <algorithm>
#include <unordered_map>
#define endl "\n"
using namespace std;
int cnt[26];
int main(){
	ios::sync_with_stdio(0);
	cin.tie(0),cout.tie(0);
	int t;
	cin >> t;
	while(t--){
		int n;
		unordered_map<string,bool> S[26];
		cin >> n;
		for(int i=0;i<26;i++) cnt[i]=0;
		while(n--){
			string name;
			char id;
			string state;
			cin >> name >> id >> state;
			if(state=="accepted"){
				int p=id-'A';
				if(!S[p].count(name)){
					cnt[p]++;
					S[p][name]=true;
				}
			}
		}
		int mx=0;
		for(int i=0;i<26;i++) mx=max(mx,cnt[i]);
		for(int i=0;i<26;i++)
			if(cnt[i]==mx){
				cout << char(65+i) << endl;
				break;
			}
	} 
	return 0;
}