QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#779470 | #9223. Data Determination | ACKADE | WA | 0ms | 3812kb | C++23 | 1001b | 2024-11-24 19:18:16 | 2024-11-24 19:18:17 |
Judging History
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'