-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCLEANUP.cpp
65 lines (60 loc) · 1.23 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
55
56
57
58
59
60
61
62
63
64
65
//CLEANUP
//unsolved and incomplete
#include <bits/stdc++.h>
#include <stdlib.h>
using namespace std;
int main()
{
int t,n,m,p[10010] = {0}, chef[10010]={0},assistant[10010] = {0}, j, x, y, k;
cin>>t;
while(t--)
{
cin>>n>>m;
for (int i=1; i<=m; i++)
{
cin>>k;
p[k]=-1;
}
j=1;
x=1;
y=1;
for(int i=1; i<=n; i++)
{
if(p[i]==0)
{
if(j%2==1)
{
chef[x]=i;
x++;
}
else
{
assistant[y] = i;
y++;
}
}
}
for(int i=1; i<=x; i++)
cout<<chef[i]<<" ";
cout<<endl;
for(int i=1; i<=y; i++)
cout<<assistant[i]<<" ";
cout<<endl;
/*
sort(q,q+m-n);
for(int i=0; i<n-m; i++)
{
if(i%2==0)
printf("%d ", q[i]);
}
printf("\n");
for(int i=0; i<n-m; i++)
{
if(i%2==1)
printf("%d ", q[i]);
}
cout<<endl;
*/
}
return 0;
}