QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#388322#8549. The Gameucup-team3396#WA 4ms54088kbC++14990b2024-04-13 14:45:282024-04-13 14:45:29

Judging History

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

  • [2024-04-13 14:45:29]
  • 评测
  • 测评结果:WA
  • 用时:4ms
  • 内存:54088kb
  • [2024-04-13 14:45:28]
  • 提交

answer

#include<bits/stdc++.h>
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
#define pii pair<ll,ll>
#define rep(i,a,b) for(ll i=(a);i<=(b);++i)
#define per(i,a,b) for(ll i=(a);i>=(b);--i)
using namespace std;
bool Mbe;
ll read(){
    ll x=0,f=1;char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
    return x*f;
}
void write(ll x){
    if(x<0)putchar('-'),x=-x;
    if(x>9)write(x/10);
    putchar(x%10+'0');
}
const ll N=2e6+9;
ll T,n,a[N],tag[N];
vector<ll>v[N];
void solve(){
    n=read();
    rep(i,0,n*2+1)v[i].clear(),tag[i]=0;
    rep(i,1,n*2)a[i]=read(),tag[a[i]]++;
    ll o=max_element(tag+1,tag+n*2+1)-tag;
    tag[o]--;
    if(*max_element(tag+1,tag+n*2+1)>=max(2ll,n-1))puts("Qingyu");
    else puts("Kevin");
}
bool Med;
int main(){
    cerr<<fabs(&Med-&Mbe)/1048576.0<<"MB\n";
    T=read();
    while(T--)solve();
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 4ms
memory: 54088kb

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: 4ms
memory: 53228kb

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
Qingyu
Qingyu
Qingyu
Qingyu
Qingyu
Qingyu
Qingyu
Qingyu
Qingyu
Qingyu
Qingyu
Kevin
Qingyu
Kevin
Qingyu
Qingyu
Qingyu
Qingyu
Qingyu
Kevin
Qingyu
Qingyu
Qingyu
Kevin
Qingyu
Qingyu
Qingyu
Kevin
Qingyu
Qingyu
Qingyu
Qingyu
Qingyu
Kevin
Qingyu
Kevin
Kevin
Qingyu
Qingyu
...

result:

wrong answer 3rd words differ - expected: 'Kevin', found: 'Qingyu'