You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
#include <cstdio>
|
|
#include <set>
|
|
int main()
|
|
{
|
|
int t, n;
|
|
scanf("%d", &t);
|
|
while (t--)
|
|
{
|
|
scanf("%d", &n);
|
|
std::set<int> S;
|
|
for (int i = 0, x; i < n; i++)
|
|
{
|
|
scanf("%d", &x);
|
|
if (S.count(x) == 0)
|
|
S.insert(x), printf(i == 0 ? "%d" : " %d", x);
|
|
}
|
|
putchar('\n');
|
|
}
|
|
} |