QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#577872#9320. Find the Easiest ProblemzjhhhzjWA 12ms3596kbC++17833b2024-09-20 15:12:242024-09-20 15:12:25

Judging History

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

  • [2024-09-20 15:12:25]
  • 评测
  • 测评结果:WA
  • 用时:12ms
  • 内存:3596kb
  • [2024-09-20 15:12:24]
  • 提交

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<<'\n';
}
int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);
	int _ = 1;
	cin >> _;
	while (_--) {
		solve();
	}
	return 0;
}
/*
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
*/

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3596kb

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
A

result:

ok 2 lines

Test #2:

score: -100
Wrong Answer
time: 12ms
memory: 3512kb

input:

1000
44
WaiooyIXa O accepted
WaiooyIXa P accepted
ZYYsNWag P accepted
DPIawQg D rejected
IzPdjnM Z rejected
Ra D rejected
kwQyGxLo I rejected
DPIawQg L accepted
kwQyGxLo I accepted
mmWxDuADCB D rejected
PXwVAOgwiz P rejected
ZYYsNWag U accepted
IzPdjnM Z accepted
TgBNO P rejected
kwQyGxLo J accepted...

output:

Z
P
P
H
H
H
Z
H
H
H
H
H
H
H
H
H
J
F
F
D
D
D
D
D
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
...

result:

wrong answer 2nd lines differ - expected: 'E', found: 'P'