QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#387774 | #4824. Bracket-and-bar Sequences | berarchegas# | 0 | 0ms | 0kb | C++20 | 828b | 2024-04-12 19:59:38 | 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
*/
Details
Tip: Click on the bar to expand more detailed information
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)