QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#294231#4825. Even and Odd Combinationsucup-team866#0 0ms3900kbC++14424b2023-12-30 10:29:282023-12-30 10:29:29

Judging History

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

  • [2023-12-30 10:29:29]
  • 评测
  • 测评结果:0
  • 用时:0ms
  • 内存:3900kb
  • [2023-12-30 10:29:28]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
int T, n, k, a[114];
int main() {
	cin >> T;
	while (T --) {
		scanf ("%d%d", &n, &k);
		for (int i=1; i<=k; i++) scanf ("%d", &a[i]);
		if (a[1] == 1) {
			printf ("%d %d\n", n, k - 1);
			for (int i=2; i<=k; i++) printf ("%d ", a[i]); puts ("");
		} else {
			printf ("%d %d\n1", n, k + 1);
			for (int i=1; i<=k; i++) printf (" %d", a[i]); puts ("");
		}
	}
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3900kb

input:

6
3 0
2 1
1
3 3
1 2 3
3 1
1
3 1
2
3 1
3

output:

3 1
1
2 0

3 2
2 3 
3 0

3 2
1 2
3 2
1 3

input:

6
3 1
1
2 0
3 2
2 3
3 0
3 2
1 2
3 2
1 3

output:

3 0

2 -1

3 3
1 2 3
3 1
1
3 1
2 
3 1
3 

result:

wrong answer 3rd lines differ - expected: '2 1', found: '2 -1'