QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#577867 | #9320. Find the Easiest Problem | zjhhhzj | WA | 0ms | 3548kb | C++17 | 662b | 2024-09-20 15:10:57 | 2024-09-20 15:10:58 |
Judging History
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'