-
Notifications
You must be signed in to change notification settings - Fork 22
/
CLEANUP.cpp
54 lines (43 loc) · 1.01 KB
/
CLEANUP.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include<bits/stdc++.h>
using namespace std;
int main()
{
long long t;
cin>>t;
while(t--){
long int n, m;
cin>>n>>m;
int job[n];
for(long int i=0; i<n; i++) job[i]=0;
for(long int i=0; i<m; i++){
long int temp;
cin>>temp;
job[temp-1]=-1;
}
bool isHeadChef = true;
//1 for head chef 2 for assistant
for(long int i=0; i<n; i++){
if(job[i]!=-1){
if(isHeadChef){
job[i] = 1;
isHeadChef = false;
}else {
job[i] = 2;
isHeadChef = true;
}
}
}
for(long int i=0; i<n; i++){
if(job[i]==1) cout<<i+1<<" ";
}cout<<"\n";
for(long int i=0; i<n; i++){
if(job[i]==2) cout<<i+1<<" ";
}
}
return 0;
}