QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#418428 | #8549. The Game | tarjen# | WA | 1ms | 3836kb | C++20 | 665b | 2024-05-23 13:52:02 | 2024-05-23 13:52:03 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
string solve()
{
int n;cin>>n;
vector<int> ma(n*2+1);
for(int i=1;i<=2*n;i++){
int x;cin>>x;
ma[x]++;
}
vector<int> v;
for(auto &it:ma)if(it>0)v.push_back(it);
sort(v.begin(),v.end());
int now=0;
for(int i=1;i<n;i++){
if(now+1==(int)v.size())return "Qingyu";
if(--v.back()==0)v.pop_back();
if(--v[now]==0)now++;
}
if(now+1==(int)v.size())return "Qingyu";
else return "Kevin";
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
int T;cin>>T;while(T--)cout<<solve()<<"\n";
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3836kb
input:
3 3 1 1 4 5 1 4 2 1 2 3 4 4 1 2 2 3 2 1 1 4
output:
Kevin Kevin Qingyu
result:
wrong answer 1st words differ - expected: 'Qingyu', found: 'Kevin'