QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#576510#9320. Find the Easiest ProblemkramQAQWA 0ms3628kbC++14626b2024-09-19 20:44:322024-09-19 20:44:32

Judging History

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

  • [2024-09-19 20:44:32]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3628kb
  • [2024-09-19 20:44:32]
  • 提交

answer

#include <bits/stdc++.h>
#define endl '\n'
#define int long long
using namespace std;
 
void solve()
{
	int n;
	cin >> n;
	map<char,int> mp;
	for (int i = 0 ; i < n ; ++i){
		string s1,s2;
		char x;
		cin >> s1;
		cin >> x;
		cin >> s2;
		if (s2 == "accepted") mp[x]++; 
	}
	int max = 0;
	char ans = 'A'-1;
	for (auto& i: mp){
		if (i.second > max || i.second == max && i.first > ans){
			max = i.second;
			ans = i.first;
		}
	}
	cout << ans << endl;
}
 
 
signed main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int t=1;
	cin>>t;
	while(t--){
	solve();
	}
	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'