QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#387776 | #4825. Even and Odd Combinations | berarchegas# | 0 | 0ms | 0kb | C++20 | 823b | 2024-04-12 20:01:05 | 2024-04-12 20:01:05 |
answer
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
template<typename T>
using matrix = vector<vector<T>>;
const int MAXN = 50;
int main(){
cin.tie(0)->sync_with_stdio(0);
int t;
cin >> t;
while(t--){
int n, k;
cin >> n >> k;
vector<int> v(k);
for(int& i : v)
cin >> i;
set<int> s;
for(int i = 1; i <= n; i++)
s.insert(i);
for(int i = 0; i < v.size(); i++){
s.erase(v[i]);
}
if(n%2 == 1){
if(s.count(1))
s.erase(1);
else s.insert(1);
}
cout << n << ' ' << s.size() << '\n';
for(int i : s)
cout << i << ' ';
cout << '\n';
}
}
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 2 2 3 2 1 2 3 1 1 3 3 1 2 3 3 1 3 3 1 2
input:
output:
result:
wrong answer the size of your subset must have a different parity (test case 1)