QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#387774#4824. Bracket-and-bar Sequencesberarchegas#0 0ms0kbC++20828b2024-04-12 19:59:382024-04-12 19:59:38

Judging History

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

  • [2024-04-12 19:59:38]
  • 评测
  • 测评结果:0
  • 用时:0ms
  • 内存:0kb
  • [2024-04-12 19:59:38]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
template<typename T>
using matrix = vector<vector<T>>;
const int MAXN = 50;

int main(){
    cin.tie(0)->sync_with_stdio(0);

    

    int t;
    cin >> t;

    while(t--){
        int n, k;
        cin >> n >> k;

        vector<int> v(k);
        for(int& i : v)
            cin >> i;
    
        set<int> s;

        for(int i = 1; i <= n; i++)
            s.insert(i);

        for(int i = 0; i < v.size(); i++){
            s.erase(v[i]);
        }
        if(s.count(1))
            s.erase(1);
        else s.insert(1);

        cout << n << ' ' << s.size() << '\n';

        for(int i : s)
            cout << i << ' ';
        cout << '\n';
    }
}

/*
3
1 2 3 
2
1 2 
0

2
2 3 
2
1 3 
2
1 2
*/

详细

Test #1:

score: 0
Wrong Answer on the first run

input:

encode
3
1
(|)
4
((((|)|)|)|)
5
(|(|))((|(|))|)

output:


input:


output:


result:

wrong output format Unexpected end of file - int64 expected (test case 1)