0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-05 15:18:47 +00:00
OI-codes/problem/P4305/P4305.cpp

37 lines
659 B
C++
Raw Normal View History

#include <bits/stdc++.h>
using namespace std;
inline void read(int& ret) {
ret = 0;
int f = 1;
char ch = getchar();
while (!isdigit(ch)) {
if (ch == '-') f = -f;
ch = getchar();
}
while (isdigit(ch)) {
ret = ret * 10 + ch - '0', ch = getchar();
}
ret *= f;
}
int main() {
int t;
read(t);
while (t--) {
int n, x;
unordered_map<int, bool> m;
read(n);
for (int i = 0; i < n; i++) {
read(x);
if (!m[x]) {
m[x] = true;
printf("%d ", x);
}
}
printf("\n");
}
return 0;
}