mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2025-01-12 22:11:59 +00:00
P4305 [JLOI2011]不重复数字
R44293313
This commit is contained in:
parent
75ab6b2190
commit
9c20446432
@ -2,29 +2,15 @@
|
|||||||
|
|
||||||
using namespace std;
|
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 main() {
|
||||||
int t;
|
int t;
|
||||||
read(t);
|
scanf("%d", &t);
|
||||||
while (t--) {
|
while (t--) {
|
||||||
int n, x;
|
int n, x;
|
||||||
unordered_map<int, bool> m;
|
unordered_map<int, bool> m;
|
||||||
read(n);
|
scanf("%d", &n);
|
||||||
for (int i = 0; i < n; i++) {
|
for (int i = 0; i < n; i++) {
|
||||||
read(x);
|
scanf("%d", &x);
|
||||||
if (!m[x]) {
|
if (!m[x]) {
|
||||||
m[x] = true;
|
m[x] = true;
|
||||||
printf("%d ", x);
|
printf("%d ", x);
|
||||||
|
Loading…
Reference in New Issue
Block a user