全WA求调,测试用例能过~
查看原帖
全WA求调,测试用例能过~
1379790
chengwei_hust楼主2024/11/24 16:04
#include<iostream>
#include<unordered_set>
#include<stack>
using namespace std;

int main(){
	int t;
	cin >> t;
	while(t--){
		int n;
		cin >> n;
		unordered_set<int> s;
		stack<int> v;
		while(n--){
			int a;
			cin >> a;
			s.insert(a);
		}
		for(auto e:s)v.push(e);
		while(!v.empty()){
			cout << v.top() << ' ';
			v.pop();
		}
		cout << endl;
	}
}
2024/11/24 16:04
加载中...