0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-12-25 18:52:06 +00:00

P4305 [JLOI2011]不重复数字

R44293000
This commit is contained in:
Baoshuo Ren 2020-12-27 11:05:44 +08:00 committed by Baoshuo Ren
parent 0ede4b6a2d
commit 75ab6b2190
Signed by: baoshuo
GPG Key ID: 70F90A673FB1AB68

36
problem/P4305/P4305.cpp Normal file
View File

@ -0,0 +1,36 @@
#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;
}