QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#395112 | #7942. $K$ Subsequences | pkien01 | WA | 1ms | 3580kb | C++23 | 530b | 2024-04-21 05:01:44 | 2024-04-21 05:01:45 |
Judging History
answer
/*input
5
3 2
1 -1 1
4 2
-1 1 1 -1
7 3
1 1 1 1 1 1 1
10 3
1 1 1 1 -1 -1 1 1 1 1
12 4
1 1 1 1 -1 -1 -1 -1 1 1 1 1
*/
#include <bits/stdc++.h>
using namespace std;
array<int, 200001> arr;
int main() {
int t; cin >> t;
while (t--) {
int n, k;
cin >> n >> k;
for (int i = 0; i < n; i++) cin >> arr[i];
if (k == 1) {
for (int i = 0; i < n; i++) cout << 1 << " ";
cout << endl;
}
else {
for (int i = 0; i < n; i++) cout << (arr[i] < 0? 1 : 2) << " ";
cout << endl;
}
}
}
详细
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3580kb
input:
5 3 2 1 -1 1 4 2 -1 1 1 -1 7 3 1 1 1 1 1 1 1 10 3 1 1 1 1 -1 -1 1 1 1 1 12 4 1 1 1 1 -1 -1 -1 -1 1 1 1 1
output:
2 1 2 1 2 2 1 2 2 2 2 2 2 2 2 2 2 2 1 1 2 2 2 2 2 2 2 2 1 1 1 1 2 2 2 2
result:
wrong answer Jury found better answer than participant (test case 1)