QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#322212#4825. Even and Odd Combinationsminhnhatnoe0 0ms3840kbC++14597b2024-02-06 15:12:122024-02-06 15:12:13

Judging History

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

  • [2024-02-06 15:12:13]
  • 评测
  • 测评结果:0
  • 用时:0ms
  • 内存:3840kb
  • [2024-02-06 15:12:12]
  • 提交

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'