QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#322212 | #4825. Even and Odd Combinations | minhnhatnoe | 0 | 0ms | 3840kb | C++14 | 597b | 2024-02-06 15:12:12 | 2024-02-06 15:12:13 |
answer
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
signed main(){
cin.tie(0)->sync_with_stdio(0);
int t; cin >> t;
for (int i=0; i<t; i++){
int n, k; cin >> n >> k;
vector<int> a(k);
for (int i=0; i<k; i++){
cin >> a[i];
}
auto it = find(a.begin(), a.end(), 1);
if (it == a.end()) a.insert(a.begin(), 1);
else a.erase(it);
cout << n << " " << a.size() << "\n";
for (int i=0; i<a.size(); i++){
cout << a[i] << " \n"[i == a.size()-1];
}
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3840kb
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 1 3 3 1 2 3 3 1 1 3 1 2 3 1 3
result:
wrong answer 2nd lines differ - expected: '', found: '2 1'