QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#407240#8549. The GamecgcWA 3ms3612kbC++14577b2024-05-08 12:03:322024-05-08 12:03:33

Judging History

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

  • [2024-05-08 12:03:33]
  • 评测
  • 测评结果:WA
  • 用时:3ms
  • 内存:3612kb
  • [2024-05-08 12:03:32]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 2e6 + 10;
int cnt[N];
void slove(){
	int n;
	cin >> n;
	for(int i = 1 ; i <= 2*n ; i++) cnt[i] = 0;
	int a;
	int cnt1 = 0, cnt2 = 0;
	for(int i = 1 ; i <= 2*n ; i++){
		cin >> a;
		if(cnt[a]){
			if(cnt[a] == 1) cnt2++;
			cnt2++;
		}
		else{
			cnt[a] = 1;			
		}
	}
	cnt1 = 2*n - cnt2;
	if(cnt2 >= cnt1) cout << "Qingyu\n";
	else cout << "Kevin\n";
}
int main(){
	ios::sync_with_stdio(0), cin.tie(0);
	int t;
	cin >> t;
	while(t--){
		slove();
	} 
	return 0;
} 

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3612kb

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: 3588kb

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'