QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#414740 | #8549. The Game | liaoyingyu | WA | 15ms | 19372kb | C++20 | 493b | 2024-05-19 16:14:08 | 2024-05-19 16:14:09 |
Judging History
answer
#include<bits/stdc++.h>
#define int long long
const int N=2000000+10;
using namespace std;
bool cmp(int x,int y){
return x<y;
}
signed main(){
int t,n,a[N];
cin>>t;
while(t--){
cin>>n;
for(int i=1;i<=2*n;i++){
cin>>a[i];
}
sort(a+1,a+1+2*n,cmp);
int ans=0,shu=1;
for(int i=2;i<=2*n;i++){
if(a[i]!=a[i-1]){
ans+=shu-1;
shu=1;
}
else{
shu++;
}
}
if(ans>=n) printf("Qingyu\n");
else printf("Kevin\n");
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 3ms
memory: 19372kb
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: 15ms
memory: 19288kb
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:
Kevin Qingyu Kevin Qingyu Kevin Kevin Kevin Qingyu Kevin Kevin Kevin Kevin Kevin Kevin Kevin Kevin Kevin Kevin Kevin Qingyu Kevin Kevin Kevin Kevin Kevin Kevin Kevin Kevin Kevin Kevin Qingyu Kevin Kevin Kevin Kevin Kevin Kevin Kevin Kevin Kevin Kevin Kevin Kevin Kevin Kevin Kevin Kevin Kevin Qingyu ...
result:
wrong answer 1st words differ - expected: 'Qingyu', found: 'Kevin'