QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#292960#4825. Even and Odd Combinationsucup-team1447#0 1ms3528kbC++14682b2023-12-28 17:47:122023-12-28 17:47:13

Judging History

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

  • [2023-12-28 17:47:13]
  • 评测
  • 测评结果:0
  • 用时:1ms
  • 内存:3528kb
  • [2023-12-28 17:47:12]
  • 提交

answer

// This Code was made by Chinese_zjc_.
#include <bits/stdc++.h>
int T, n, k;
signed main()
{
    std::ios::sync_with_stdio(false);
    std::cin >> T;
    while (T--)
    {
        long long ans = 0;
        std::vector<int> g;
        std::cin >> n >> k;
        for (int i = 0, c; i != k; ++i)
            std::cin >> c, ans ^= 1ll << c >> 1;
        ans ^= 1;
        for (int i = 0; i != n; ++i)
            if (ans >> i & 1)
                g.push_back(i + 1);
        std::cout << n << ' ' << g.size();
        for (int i = 0; i != int(g.size()); ++i)
            std::cout << " \n"[i == 0] << g[i];
        std::cout << std::endl;
    }
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 3528kb

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'