QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#644607 | #8549. The Game | Orthos | WA | 6ms | 3820kb | C++17 | 850b | 2024-10-16 14:46:20 | 2024-10-16 14:46:20 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int t,n,m;
int a[2000006];
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
cin>>t;
while(t--){
map<int,int> mp;
cin>>n;
for(int i=1;i<=2*n;i++){
cin>>a[i];
mp[a[i]]++;
}
int cnt1=0,cnt2=0;
ll sum=0;
ll ans=0;
for(auto v:mp){
if(v.second>=2){
cnt1++;
sum+=v.second;
}
else{
cnt2++;
}
}
if(cnt1==1){
ans=sum-1;
}
else{
ans=sum-cnt1-1;
}
if(ans>cnt2){
cout<<"Qingyu\n";
}
else{
cout<<"Kevin\n";
}
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3820kb
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: 0
Accepted
time: 4ms
memory: 3632kb
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 Kevin Qingyu Kevin Kevin Kevin Qingyu Qingyu Kevin Kevin Kevin Kevin Qingyu Kevin Kevin Kevin Kevin Kevin Qingyu Kevin Kevin Qingyu Kevin Kevin Kevin Qingyu Kevin Kevin Kevin Qingyu Kevin Kevin Kevin Kevin Kevin Qingyu Kevin Kevin Kevin Kevin Kevin Qingyu Kevin Kevin Kevin Qingyu Qingy...
result:
ok 10000 tokens
Test #3:
score: 0
Accepted
time: 6ms
memory: 3604kb
input:
10000 4 5 7 5 4 2 3 8 2 4 5 3 3 7 7 1 2 6 4 7 4 5 1 5 6 6 4 4 8 7 7 8 1 7 2 2 4 6 7 7 1 8 1 1 3 4 5 4 1 8 6 1 2 6 4 2 8 3 4 2 4 8 7 4 3 3 1 7 7 7 2 3 4 4 7 2 1 3 7 4 7 4 2 3 8 5 3 8 3 8 4 3 4 3 1 3 1 4 4 4 3 6 5 2 2 6 4 7 4 7 6 6 4 3 3 8 6 4 5 2 1 5 4 7 5 6 4 1 7 3 2 2 5 8 5 4 8 8 3 7 2 3 6 6 4 7 5 ...
output:
Kevin Kevin Kevin Qingyu Kevin Kevin Kevin Qingyu Kevin Qingyu Qingyu Kevin Kevin Kevin Kevin Kevin Kevin Qingyu Kevin Qingyu Kevin Kevin Kevin Kevin Kevin Kevin Qingyu Kevin Kevin Kevin Kevin Kevin Kevin Kevin Kevin Kevin Kevin Kevin Kevin Kevin Kevin Kevin Kevin Kevin Kevin Qingyu Kevin Kevin Kevi...
result:
ok 10000 tokens
Test #4:
score: -100
Wrong Answer
time: 4ms
memory: 3624kb
input:
10000 5 9 7 9 8 5 2 1 4 4 6 5 9 7 9 9 3 3 9 3 5 8 5 10 8 10 4 5 3 10 1 7 2 5 4 4 3 2 1 5 1 6 9 4 5 7 10 10 9 7 5 9 8 10 1 5 3 9 1 2 4 1 4 2 9 8 5 8 2 3 6 5 5 3 9 4 7 5 7 3 5 7 2 9 1 7 6 6 5 3 2 5 3 10 3 7 7 10 7 5 9 2 3 3 7 9 5 4 6 6 5 8 9 5 1 9 8 6 10 7 10 5 4 7 9 3 5 3 2 4 5 4 5 5 4 2 3 2 1 1 6 2 ...
output:
Kevin Qingyu Kevin Kevin Kevin Qingyu Kevin Kevin Qingyu Kevin Kevin Kevin Kevin Kevin Kevin Kevin Kevin Kevin Kevin Kevin Kevin Qingyu Kevin Kevin Kevin Kevin Kevin Kevin Kevin Qingyu Kevin Kevin Kevin Qingyu Kevin Kevin Kevin Kevin Kevin Kevin Kevin Kevin Kevin Kevin Kevin Kevin Kevin Kevin Qingyu...
result:
wrong answer 6th words differ - expected: 'Kevin', found: 'Qingyu'