QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#395112#7942. $K$ Subsequencespkien01WA 1ms3580kbC++23530b2024-04-21 05:01:442024-04-21 05:01:45

Judging History

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

  • [2024-04-21 05:01:45]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3580kb
  • [2024-04-21 05:01:44]
  • 提交

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)