QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#577867#9320. Find the Easiest ProblemzjhhhzjWA 0ms3548kbC++17662b2024-09-20 15:10:572024-09-20 15:10:58

Judging History

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

  • [2024-09-20 15:10:58]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3548kb
  • [2024-09-20 15:10:57]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mod (1000000007)
#define PII pair<int,int>
#define F first
#define S second
#define N 200005
ll n,m,a[N];
map<char,map<string,int> >mp;
string s,re;
char ch;
void solve() {
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>s>>ch>>re;
		if(re=="accepted"){
			mp[ch][s]=1;
		}
	}
	ll mx=0;
	for(auto [x,y]:mp){
		if(y.size()>mx){
			mx=y.size();
			ch=x;
		}else if(y.size()==mx&&x<ch){
			ch=x;
		}
	}
	cout<<ch;
}
int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);
	int _ = 1;
	cin >> _;
	while (_--) {
		solve();
	}
	return 0;
}
/*
*/

详细

Test #1:

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

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:

AA

result:

wrong answer 1st lines differ - expected: 'A', found: 'AA'