QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#571995 | #8549. The Game | wangjingheng | WA | 3ms | 3600kb | C++14 | 544b | 2024-09-18 10:54:20 | 2024-09-18 10:54:21 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
void solve(){
int n;cin>>n;
vector<int> c(n+n+1),a;
for(int i=1;i<=n+n;i++){
int x;cin>>x;
c[x]++;
}
int t=0,ok=0,cnt=0;
for(int i=1;i<=n+n;i++){
if(c[i]==1) cnt++;
else if(c[i]!=0)a.push_back(c[i]-1);
}
for(int i=0;i<a.size();i++){
int it=a[i];
cnt-=it;
if(cnt<=0) ok=1;
}
if(ok){
cout<<"Qingyu\n";
}
else cout<<"Kevin\n";
}
signed main(){
ios::sync_with_stdio(false);
cin.tie(0);cout.tie(0);
int T;cin>>T;
while(T--)
solve();
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3600kb
input:
3 3 1 1 4 5 1 4 2 1 2 3 4 4 1 2 2 3 2 1 1 4
output:
Qingyu Kevin Qingyu
result:
ok 3 tokens
Test #2:
score: -100
Wrong Answer
time: 3ms
memory: 3516kb
input:
10000 3 5 5 3 5 4 5 3 1 4 3 1 1 3 3 1 6 3 3 4 4 3 3 4 1 3 1 1 3 5 6 6 3 1 3 3 4 5 1 5 6 5 3 6 2 4 4 6 1 3 4 6 4 4 2 4 3 6 4 1 6 4 6 3 2 4 6 4 2 3 3 2 4 1 5 5 4 3 1 3 6 5 1 1 3 3 2 1 5 3 1 3 6 6 6 2 2 5 3 1 5 2 5 3 3 3 1 3 3 5 4 5 3 1 3 4 2 4 5 3 3 5 6 2 2 2 3 4 3 3 1 2 6 3 3 3 3 3 6 3 3 4 1 3 6 6 4 ...
output:
Qingyu Qingyu Qingyu Qingyu Qingyu Kevin Qingyu Qingyu Qingyu Qingyu Qingyu Kevin Qingyu Qingyu Qingyu Qingyu Kevin Kevin Kevin Qingyu Qingyu Qingyu Qingyu Kevin Kevin Kevin Qingyu Kevin Kevin Qingyu Qingyu Qingyu Kevin Qingyu Qingyu Qingyu Qingyu Kevin Kevin Kevin Kevin Kevin Qingyu Kevin Qingyu Ke...
result:
wrong answer 3rd words differ - expected: 'Kevin', found: 'Qingyu'