Skip to content

Instantly share code, notes, and snippets.

@yooniversal
Created September 9, 2020 05:02
[CODEFORCES] ROUND #656 (DIV. 3) B
#include <iostream>
#include <cstdio>
#include <vector>
using namespace std;
bool chk[51];
int main() {
cin.tie(nullptr);
cout.tie(NULL);
ios_base::sync_with_stdio(false);
int t;
cin >> t;
while (t--) {
int n;
cin >> n;
vector<int> ans;
for (int i = 0; i < 2 * n; i++) {
int tmp;
cin >> tmp;
if (!chk[tmp]) {
ans.push_back(tmp);
chk[tmp] = true;
}
}
for (int i = 0; i < ans.size(); i++)
cout << ans[i] << " ";
cout << '\n';
memset(chk, false, sizeof(chk));
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment