QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#779481#9223. Data DeterminationACKADEWA 68ms14552kbC++231006b2024-11-24 19:21:092024-11-24 19:21:09

Judging History

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

  • [2024-11-24 19:21:09]
  • 评测
  • 测评结果:WA
  • 用时:68ms
  • 内存:14552kb
  • [2024-11-24 19:21:09]
  • 提交

answer

#include<bits/stdc++.h>
#define int long long
#define endl '\n'
using namespace std;
const int N = 200010;
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: 100
Accepted
time: 0ms
memory: 3804kb

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:

TAK
NIE
NIE

result:

ok 3 lines

Test #2:

score: 0
Accepted
time: 68ms
memory: 14552kb

input:

1
200000 2 482043846
410684388 380438852 309193412 468460689 586281084 680820569 266819813 639025900 488292166 503516930 532292185 618277661 728546481 628339224 673945619 471325257 372807753 325778059 372151033 548358519 276494019 336701079 320784795 377493322 385262271 621712987 349634764 668994576...

output:

NIE

result:

ok single line: 'NIE'

Test #3:

score: 0
Accepted
time: 28ms
memory: 4904kb

input:

10
20000 3530 502140211
367996343 553577602 581694419 435810361 532394401 431613294 485360190 608191058 506969937 531905607 429252296 360241499 519031654 250454430 478548102 753825992 450326073 603766643 566036856 511634983 416622101 753825992 753825992 380511285 390746506 436237616 342529443 878920...

output:

NIE
TAK
TAK
NIE
TAK
NIE
NIE
NIE
NIE
NIE

result:

ok 10 lines

Test #4:

score: 0
Accepted
time: 28ms
memory: 4652kb

input:

10
20000 6 569116309
533654855 569116308 512534907 569116310 500238175 562175605 569116308 569116310 489499020 543748669 569116309 526641247 511510060 504576222 569116309 569116310 569116308 569116310 569116309 569116308 569116309 569116310 569116308 569116310 569116309 569116308 465300463 569116308...

output:

TAK
TAK
NIE
NIE
NIE
NIE
NIE
TAK
NIE
TAK

result:

ok 10 lines

Test #5:

score: -100
Wrong Answer
time: 21ms
memory: 5172kb

input:

1
200000 99999 519401084
60561374 111262859 724696443 994449169 60561374 44352999 44352999 994449169 333890219 44352999 326562388 994449169 60561374 994449169 111262859 614556033 60561374 994449169 60561374 994449169 44352999 994449169 60561374 335786619 994449169 994449169 629087444 44352999 464308...

output:

NIE

result:

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