QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#567827 | #9320. Find the Easiest Problem | jianwu | WA | 23ms | 3620kb | C++17 | 1009b | 2024-09-16 14:06:41 | 2024-09-16 14:06:42 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll t;
void solve()
{
ll n;
cin>>n;
map<char,set<string>> mp;
for(int i=1;i<=n;i++)
{
string a,c;
char b;
cin>>a>>b>>c;
if(c=="accepted")
{
if(mp.count(b))
{
mp[b].insert(a);
}
else
{
set<string> s;
s.insert(a);
mp.insert({b,s});
}
}
}
// cout<<mp.size()<<'\n';
char name='Z';
ll cnt=-1;
for(auto x:mp)
{
// cout<<x.second.size()<<'\n';
ll c=x.second.size();
if(c>=cnt)
{
cnt=c;
if(x.first<name)
{
name=x.first;
}
}
// cout<<cnt<<'\n';
}
cout<<name<<'\n';
}
signed main()
{
cin>>t;
while(t-->0)
{
solve();
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3608kb
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: 23ms
memory: 3620kb
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:
A C A A A B A A A A D A F B A C A A A A A A A A A A A B A A A A B B B G B A A A C D A C D A A A A C J A A A A A A B B A A A A A B A C A A G C A E A A A E A B B A B A B A A F B A C C C C A A F A A A A B A B A A A A A A B B A B B A A A A B B A A A B A A B A G B A A G B A A A A B A A A B A A F B A B H ...
result:
wrong answer 1st lines differ - expected: 'Z', found: 'A'