社区讨论

90分

P4305[JLOI2011] 不重复数字参与者 2已保存回复 1

讨论操作

快速查看讨论及其快照的属性,并进行相关操作。

当前回复
1 条
当前快照
1 份
快照标识符
@m6bxsaoi
此快照首次捕获于
2025/01/25 16:36
去年
此快照最后确认于
2025/11/04 10:40
4 个月前
查看原帖
CPP
#include <bits/stdc++.h>
using namespace std;
int main(){
	int t;
	cin>>t;
	while(t--){
		int n;
		cin>>n;
		vector<int> a(n),b;
		map<int,bool> m;
		for(int i=0;i<n;i++){
			cin>>a[i];
			if(m[a[i]])continue;
			b.push_back(a[i]);
			m[a[i]]=1;
  		}
		for(auto i:a)cout<<i<<" ";
		cout<<endl;
	}	
	return 0;
}


回复

1 条回复,欢迎继续交流。

正在加载回复...