QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#779470#9223. Data DeterminationACKADEWA 0ms3812kbC++231001b2024-11-24 19:18:162024-11-24 19:18:17

Judging History

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

  • [2024-11-24 19:18:17]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3812kb
  • [2024-11-24 19:18:16]
  • 提交

answer

#include<bits/stdc++.h>
#define int long long
#define endl '\n'
using namespace std;
const int N = 1;
int sz[N];

void solve() {
    int n, k, m;
    cin >> n >> k >> m;
    for (int i = 1; i <= n; i++) {
        cin >> sz[i];
    }
    sort(sz + 1, sz + 1 + n);
    if (k & 1) {
        for (int i = 1; i <= n; i++) {
            if (sz[i] == k && i > (k - 1) / 2 && n - i >= (k - 1) / 2) {
                cout << "TAK" << endl;
                return;
            }
        }
        cout << "NIE" << endl;
    } else {
        set<int> st;
        st.insert(sz[n - k / 2 + 1]);
        for (int i = n - k / 2; i >= k / 2; i--) {
            if (st.count(2 * m - sz[i])) {
                cout << "TAK" << endl;
                return;
            }
            st.insert(sz[i]);
        }
        cout << "NIE" << endl;
    }
}

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

詳細信息

Test #1:

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

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'