From 75ab6b2190322f8dd231f578185ccdeccaf1ce36 Mon Sep 17 00:00:00 2001 From: Ren Baoshuo Date: Sun, 27 Dec 2020 11:05:44 +0800 Subject: [PATCH] =?UTF-8?q?P4305=20[JLOI2011]=E4=B8=8D=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E6=95=B0=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit R44293000 --- problem/P4305/P4305.cpp | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 problem/P4305/P4305.cpp diff --git a/problem/P4305/P4305.cpp b/problem/P4305/P4305.cpp new file mode 100644 index 00000000..83f6d3f6 --- /dev/null +++ b/problem/P4305/P4305.cpp @@ -0,0 +1,36 @@ +#include + +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 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; +}