60pts求助&4RE
查看原帖
60pts求助&4RE
561638
Tanhaoyue2011楼主2025/7/29 09:30
#include<iostream>

using namespace std;

const int N = 500005;
int t,n;
int a[N];
bool b[N];
int main(){
	cin >> t;
	while(t--){
		cin >> n;
		for(int i = 0; i < N; i++){
			b[i] = false;	
		}
		for(int i = 1; i <= n; i++){
			cin >> a[i];
			if(b[a[i]] == false){
				cout << a[i] << " ";
				b[a[i]] = true;
			}
		}
		cout << endl;
	}
	return 0;
} 
2025/7/29 09:30
加载中...