QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#418428#8549. The Gametarjen#WA 1ms3836kbC++20665b2024-05-23 13:52:022024-05-23 13:52:03

Judging History

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

  • [2024-05-23 13:52:03]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3836kb
  • [2024-05-23 13:52:02]
  • 提交

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'