QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#294285 | #4825. Even and Odd Combinations | ucup-team027# | 0 | 0ms | 0kb | C++14 | 903b | 2023-12-30 11:18:23 | 2023-12-30 11:18:23 |
answer
#include<bits/stdc++.h>
#define int long long
using namespace std;
signed main(){
ios::sync_with_stdio(0); cin.tie(0);
// freopen("input.txt","r",stdin);
//freopen("output.txt","w",stdout);
int t;
cin >> t;
while (t--) {
int n, k;
cin >> n >> k;
vector<int> a(k);
for (int &u: a) {
cin >> u;
}
set<int> s(a.begin(), a.end());
set<int> b;
for (int i = 1 ; i <= n ; i++) {
if (s.find(i) == s.end()) {
b.insert(i);
}
}
if (n % 2 == 0) {
if (s.find(n) != s.end()) {
b.insert(n);
}
}
cout << n << " " << b.size() << "\n";
for (int u: b) {
cout << u << " ";
}
cout << "\n";
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer on the first run
input:
6 3 0 2 1 1 3 3 1 2 3 3 1 1 3 1 2 3 1 3
output:
3 3 1 2 3 2 1 2 3 0 3 2 2 3 3 2 1 3 3 2 1 2
input:
output:
result:
wrong answer the size of your subset must have a different parity (test case 2)