-
Notifications
You must be signed in to change notification settings - Fork 0
/
Problem-B.cpp
42 lines (36 loc) · 943 Bytes
/
Problem-B.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
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
// #define DEBUG
#define value(x) std::cerr << "Value of \"" << #x << "\" is " << x << '\n';
#define unto(i, begin, end) for (int i = begin; i < end; ++i)
#define print_array(array, begin, end) unto(i, begin, end) std::cout << array[i] << " \n"[i == end - 1];
int32_t main()
{
std::ios_base::sync_with_stdio(false);
std::cin.tie(NULL);
std::cout.tie(NULL);
#ifdef DEBUG
printf("DEBUG was defined at compile time\n");
#endif // DEBUG
int tests_number;
std::cin >> tests_number;
while (tests_number--)
{
std::array <int, 52> placed;
placed.fill(0);
int permutation_size;
std::cin >> permutation_size;
for (int i = 0; i < permutation_size * 2; ++i)
{
int current_number;
std::cin >> current_number;
if (placed[current_number])
{
std::cout << current_number << ' ';
}
++placed[current_number];
}
std::cout << '\n';
}
return 0;
}