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:
parent
0ede4b6a2d
commit
75ab6b2190
36
problem/P4305/P4305.cpp
Normal file
36
problem/P4305/P4305.cpp
Normal 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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user