QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#768668#4825. Even and Odd CombinationsAndeviking0 0ms3596kbC++20741b2024-11-21 13:30:012024-11-21 13:30:02

Judging History

你现在查看的是最新测评结果

  • [2024-11-21 13:30:02]
  • 评测
  • 测评结果:0
  • 用时:0ms
  • 内存:3596kb
  • [2024-11-21 13:30:01]
  • 提交

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'