60 RE 求条
查看原帖
60 RE 求条
1430942
qiaohaoran123楼主2025/6/22 20:27

代码:

#include<bits/stdc++.h>
using namespace std;
long long n,t,a[50005];
int main(){
	ios::sync_with_stdio(false);
	cin>>t;
	while(t--){
		memset(a,0,sizeof(a));
		cin>>n;
		for(int i=1;i<=n;i++)cin>>a[i];
		bool use[50005]={};
		for(int i=1;i<=n;i++)if(use[a[i]]==0){
			cout<<a[i]<<' ';
			use[a[i]]=1;
		}
		cout<<'\n';
	}
	return 0;
}
2025/6/22 20:27
加载中...