QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#449162 | #8549. The Game | ukuk | WA | 5ms | 3820kb | C++14 | 1.4kb | 2024-06-20 19:18:47 | 2024-06-20 19:18:47 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define i64 long long
#define LL long long
#define i128 __int128
#define ull unsigned long long
#define db long double
#define PII pair<int,int>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(x) x.begin(),x.end()
#define lowbit(x) ((x)&-(x))
#define debug(x) cout<<(#x)<<" = "<<(x)<<'\n'
const double eps=1e-8;
const int mod=1e9+7;
//const int mod=998244353;
const int inf=1e9+7;
const i64 INF=1e9+7;
const int N=1e5+5;
const int M=1e6+5;
//const int g=3;
//const int gi=332748118;
LL qmi(LL a,int b){
a=(a%mod+mod)%mod;
LL ret=1;
for(;b;b>>=1,a=a*a%mod)if(b&1)ret=ret*a%mod;
return ret;
}
int Sqrt(int x){
assert(x>=0);
int t=sqrt(x);
while((t+1)*(t+1)<=x)t++;
while(t*t>x)t--;
return t;
}
int n;
int m;
int a[N],b[N];
inline void solve(){
cin>>n;
map<int,int>cnt;
for(int i=0;i<n*2;i++){
int x;cin>>x;
a[i]=x;
cnt[x]++;
}
int ok=0;
for(int i=0;i<n;i++){
if(a[i]!=a[n*2-i-1]){
ok=1;break;
}
}
if(!ok){
cout<<"Qingyu\n";
return;
}
int c=0;
for(auto t:cnt){
// debug(t.fi);
// debug(t.se);
c+=t.se==1;
}
// debug(c);
if(c*2<=n)cout<<"Qingyu\n";
else cout<<"Kevin\n";
}
signed main(){
ios::sync_with_stdio(0);
cin.tie(0);
int _=1;
cin>>_;
while(_--)solve();
return 0;
}
/*
*/
詳細信息
Test #1:
score: 100
Accepted
time: 1ms
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: -100
Wrong Answer
time: 5ms
memory: 3564kb
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 Kevin 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 Qingyu ...
result:
wrong answer 1st words differ - expected: 'Qingyu', found: 'Kevin'