求助 后四点RE
查看原帖
求助 后四点RE
681313
cute_overmind楼主2024/3/1 21:16
#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 10;
int t , n; 
int a[N];
int main()
{
   	cin >> t;
   	for(int i = 1;i <= t;i++)
   	{
        bool pd[N] = {0};
   		cin >> n;
   		for(int j = 1;j <= n;j++)
   			cin >> a[j];
        for(int j = 1;j <= n;j++)
        {
            if(pd[a[j]] == false)
   				cout << a[j] << " ";
   			pd[a[j]] = true;
        }
		cout << endl;
	}
	return 0;
 }
2024/3/1 21:16
加载中...