QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#632007#9223. Data DeterminationCu_OH_2WA 0ms3616kbC++20650b2024-10-12 11:23:462024-10-12 11:23:46

Judging History

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

  • [2024-10-12 11:23:46]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3616kb
  • [2024-10-12 11:23:46]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
using ll = long long;

void solve()
{
    int n, k, m;
    cin >> n >> k >> m;
    vector<int> a(n);
    for (int i = 0; i < n; ++i) cin >> a[i];
    sort(a.begin(), a.end());
    int l = lower_bound(a.begin(), a.end(), m) - a.begin();
    int r = upper_bound(a.begin(), a.end(), m) - a.begin();
    if (l >= r || r - l == 1 && k % 2 == 0) cout << "NIE\n";
    else if (min(l, n - r) * 2 + r - l >= k) cout << "TAK\n";
    else cout << "NIE\n";
    return;
}

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

詳細信息

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3616kb

input:

3
6 4 42
41 43 41 57 41 42
4 2 4
1 2 5 8
7 5 57
101 2 42 5 57 7 13

output:

NIE
NIE
NIE

result:

wrong answer 1st lines differ - expected: 'TAK', found: 'NIE'