QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#632007 | #9223. Data Determination | Cu_OH_2 | WA | 0ms | 3616kb | C++20 | 650b | 2024-10-12 11:23:46 | 2024-10-12 11:23:46 |
Judging History
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'