You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
535 B

#include <bits/stdc++.h>
using namespace std;
int t;//数据组数
int n;//表示给定的数
unordered_map<int, int> _map;
int x;
int main() {
ios::sync_with_stdio(false);
cin.tie(0); //注意使用cin.tie(0);
cin >> t;
while (t--) {
cin >> n;
_map.clear();
for (int i = 1; i <= n; i++) {
cin >> x;
if (!_map[x]) {
cout<<x<<" ";
_map[x] = 1;
}
}
cout << endl;
}
return 0;
}