QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#387766 | #4825. Even and Odd Combinations | berarchegas# | 0 | 2ms | 3872kb | C++20 | 761b | 2024-04-12 19:48:32 | 2024-04-12 19:48:33 |
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 = (n%2 == 0); i < v.size(); i++){
s.erase(v[i]);
}
cout << n << ' ' << s.size() << '\n';
for(int i : s)
cout << i << ' ';
cout << '\n';
}
}
/*
3
1 2 3
2
1 2
0
2
2 3
2
1 3
2
1 2
*/
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3620kb
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 2 1 2 3 0 3 2 2 3 3 2 1 3 3 2 1 2
input:
6 3 3 1 2 3 2 2 1 2 3 0 3 2 2 3 3 2 1 3 3 2 1 2
output:
3 0 2 1 1 3 3 1 2 3 3 1 1 3 1 2 3 1 3
result:
ok 12 lines
Test #2:
score: 100
Accepted
time: 1ms
memory: 3656kb
input:
1 1 0
output:
1 1 1
input:
1 1 1 1
output:
1 0
result:
ok single line: '1 0'
Test #3:
score: 100
Accepted
time: 1ms
memory: 3556kb
input:
3 1 1 1 1 0 1 1 1
output:
1 0 1 1 1 1 0
input:
3 1 0 1 1 1 1 0
output:
1 1 1 1 0 1 1 1
result:
ok 6 lines
Test #4:
score: 0
Wrong Answer
time: 2ms
memory: 3872kb
input:
1000 12 7 1 2 3 5 6 7 9 11 6 3 5 6 7 8 11 12 7 1 6 7 9 10 11 12 11 6 1 2 3 9 10 11 12 7 2 3 4 6 7 9 10 9 3 3 7 8 12 10 1 2 3 5 7 8 9 10 11 12 12 5 2 6 10 11 12 10 4 2 4 8 10 12 7 1 3 4 7 10 11 12 11 3 3 6 7 11 6 3 5 7 8 9 10 12 5 1 4 8 11 12 11 6 2 3 5 6 9 10 12 5 2 4 7 11 12 12 6 3 4 5 6 10 12 10 6...
output:
12 6 1 4 8 10 11 12 11 5 1 2 4 9 10 12 6 1 2 3 4 5 8 11 5 4 5 6 7 8 12 6 1 2 5 8 11 12 9 6 1 2 4 5 6 9 12 3 1 4 6 12 8 1 2 3 4 5 7 8 9 10 7 1 2 3 5 6 7 9 12 6 1 2 5 6 8 9 11 8 1 2 4 5 8 9 10 11 11 5 1 2 4 6 11 12 8 1 2 3 5 6 7 9 10 11 5 1 4 7 8 11 12 8 1 2 3 5 6 8 9 10 12 7 1 2 3 7 8 ...
input:
1000 12 6 1 4 8 10 11 12 11 5 1 2 4 9 10 12 6 1 2 3 4 5 8 11 5 4 5 6 7 8 12 6 1 2 5 8 11 12 9 6 1 2 4 5 6 9 12 3 1 4 6 12 8 1 2 3 4 5 7 8 9 10 7 1 2 3 5 6 7 9 12 6 1 2 5 6 8 9 11 8 1 2 4 5 8 9 10 11 11 5 1 2 4 6 11 12 8 1 2 3 5 6 7 9 10 11 5 1 4 7 8 11 12 8 1 2 3 5 6 8 9 10 12 7 1 2 3 7 8 9 11 10 5 ...
output:
12 7 1 2 3 5 6 7 9 11 6 3 5 6 7 8 11 12 7 1 6 7 9 10 11 12 11 6 1 2 3 9 10 11 12 7 1 3 4 6 7 9 10 9 3 3 7 8 12 10 1 2 3 5 7 8 9 10 11 12 12 5 1 6 10 11 12 10 4 1 4 8 10 12 7 1 3 4 7 10 11 12 11 3 3 6 7 11 6 3 5 7 8 9 10 12 5 1 4 8 11 12 11 6 2 3 5 6 9 10 12 5 1 4 7 11 12 12 6 1 4 5 6 ...
result:
wrong answer 10th lines differ - expected: '2 3 4 6 7 9 10', found: '1 3 4 6 7 9 10 '