真·水题.
AC code:
#include <cstdio>
#include <map>
using namespace std;
int T,n,t;
map<int,bool> h;
int main(){
scanf("%d",&T);
while(T--){
scanf("%d%d",&n,&t);
printf("%d",t);
h[t]=1;
for(int i=2;i<=n;i++){
scanf("%d",&t);
if(h[t]) continue;
h[t]=1;
printf(" %d",t);
}
printf("\n");
h.clear();
}
return 0;
}