QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#544395#8549. The GameHTensor#WA 3ms3712kbC++17883b2024-09-02 16:11:102024-09-02 16:11:10

Judging History

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

  • [2024-09-02 16:11:10]
  • 评测
  • 测评结果:WA
  • 用时:3ms
  • 内存:3712kb
  • [2024-09-02 16:11:10]
  • 提交

answer

#include <bits/stdc++.h>
#define dd(x) cout << #x << "\n"
#define d(x) cout << #x  << ": " << x << "\n"
using namespace std;
#define int long long
using pii = pair<int, int>;
using vpii = vector<pii>;
using vi = vector<int>;
using vii = vector<vector<int>>;
using a3 = array<int, 3>;
const int inf = 0x3f3f3f3f3f3f3f3fLL;

void solve() {
    int n; cin >> n;
    vector<int> a(2 * n + 1), cnt(2 * n + 1);
    for(int i = 1; i <= 2 * n; i++) {
        cin >> a[i];
        cnt[a[i]]++;
    }
    // int max1 = 0, max2 = 0;
    sort(cnt.begin(), cnt.end());
    int x = *--cnt.end() + *(--(--cnt.end()));
    if(x > n) cout << "Qingyu\n";
    else cout << "Kevin\n";
}

signed main() {
    ios::sync_with_stdio(false); cin.tie(0);
    int T; cin >> T;
    while(T--) solve();
    return 0;
}

/*
3
3
1 1 4 5 1 4
2
1 2 3 4
4
1 2 2 3 2 1 1 4

*/

詳細信息

Test #1:

score: 100
Accepted
time: 0ms
memory: 3584kb

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

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'