RT,我的代码
#include <iostream>
#include <cstdio>
#include <set>
using namespace std;
set <int> s;
inline int read()
{
register int ans=0;
register char c=getchar();
while(c < '0'||c > '9') c=getchar();
while(c>='0'&&c<='9')
{
ans=ans*10+(c-'0');
c=getchar();
}
return ans;
}
int main()
{
// freopen("test1.in","r",stdin);
register int t,tmp,n;
t=read();
while(t--)
{
s.clear();
n=read();
for(register int i = 0;i < n;++i)
{
tmp=read();
if(s.find(tmp)==s.end())
{
s.insert(tmp);
printf("%d ",tmp);
}
}
putchar('\n');
}
return 0;
}