-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1385B.cpp
More file actions
43 lines (40 loc) · 736 Bytes
/
Copy path1385B.cpp
File metadata and controls
43 lines (40 loc) · 736 Bytes
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
#include <iostream>
using namespace std;
int main()
{
int t,T;
cin >> T;
for(t=0;t<T;t++)
{
int n,i,p[200],arr[100];
cin >> n;
for(i=0;i<2*n;i++)
{
cin >> p[i];
}
arr[0] = p[0];
int k =1,j=0,f=0;
for(i=1;i<2*n;i++)
{
f=0;
for(j=0;j<k;j++)
{
if(p[i] == arr[j])
{
f = 1;
break;
}
}
if(f == 0 && k<n)
{
arr[k] = p[i];
k++;
}
}
for(i=0;i<n;i++)
{
cout << arr[i] << " ";
}
cout << endl;
}
}