QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#768668 | #4825. Even and Odd Combinations | Andeviking | 0 | 0ms | 3596kb | C++20 | 741b | 2024-11-21 13:30:01 | 2024-11-21 13:30:02 |
answer
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int MOD = 998244353;
void solve()
{
int n, k;
cin >> n >> k;
vector<int> a(k);
for (auto &c : a)
cin >> c;
if (!a.empty() && a.front() == 1) {
cout << n << ' ' << k - 1 << '\n';
for (int i = 1; i < k; ++i)
cout << a[i] << " \n"[i == k - 1];
}
else {
cout << n << ' ' << k + 1 << '\n';
cout << "1 ";
for (const auto &c : a)
cout << c << ' ';
cout << '\n';
}
}
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int T = 1;
cin >> T;
while (T--)
solve();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3596kb
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'