60分TLE求助
查看原帖
60分TLE求助
1179906
hhy8399楼主2024/10/6 01:23
#include <bits/stdc++.h>
#include <map>
using namespace std;

int T;
unordered_map<int, bool> pos;

void re()
{
	pos.clear();
	int n,k;
	cin >> n;
	for(int i = 1;i <= n;i++)
	{
		cin >> k;
		if(!pos[k])
		{
			pos[k] = true;
			cout << k << " ";
		}
	}
	cout << endl;
}

int main()
{
	scanf("%d",&T);
	while(T--)
	{
		re();
	}
	return 0;
}
2024/10/6 01:23
加载中...