QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#567244#9320. Find the Easiest ProblemDUSK777WA 0ms3640kbC++14801b2024-09-16 10:30:502024-09-16 10:30:50

Judging History

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

  • [2024-09-16 10:30:50]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3640kb
  • [2024-09-16 10:30:50]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define ll long long
struct node{
	ll asc;
	ll num;
};
bool cmp(node a,node b){
	if(a.num==b.num){
		return a.num>b.num;
	}
	return a.asc<b.asc;
}
void solu(){
	ll n;
	cin>>n;
	vector<set<string>> team(200);
	vector<node> cnt(200);
	for(int i=0;i<200;i++){
		cnt[i].asc=i;
	}

	
	for(int i=0;i<n;i++){
		
		string name;
		cin>>name;
		
		char problem;
		cin>>problem;
		
		string state;
		cin>>state;
		
		if(state.front()=='a'){
			ll amount = team[problem].size();
			team[problem].insert(name);
			if(amount != team[problem].size()){
				cnt[problem].num++;
			}
		}
	}
	
	sort(cnt.begin(),cnt.end(),cmp);
	
	cout<<(char)cnt[0].asc<<endl;
	
}
int main(){
	ll q;
	cin>>q;
	while(q--){
		solu();
	}
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

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'