求救,60分TLE答案
查看原帖
求救,60分TLE答案
877599
EX_EXCRSE楼主2024/4/27 16:54

rt

#include<bits/stdc++.h>
using namespace std;
int main() {
	ios::sync_with_stdio(false);
	long long T,n,b;
	unordered_map<int,bool>cnt;
	cin>>T;
	for(int i=0; i<T; i++) {
		cnt.clear();
		cin>>b;
		for(int i=0; i<b; i++) {
			cin>>n;
			if(cnt[n]==0) {
				cout<<n<<" ";
			}
			cnt[n]=1;
		}
		cout<<endl;

	}

	return 0;
}

2024/4/27 16:54
加载中...