首页 > 其他 > 详细

BZOJ 2761: [JLOI2011]不重复数字 set

时间:2019-06-26 22:13:31      阅读:137      评论:0      收藏:0      [点我收藏+]

Code:

#include<bits/stdc++.h>
#define maxn 100000 
using namespace std;
void setIO(string s)
{
	string in=s+".in"; 
	freopen(in.c_str(),"r",stdin); 
}
set<int>S; 
set<int>::iterator it; 
int arr[maxn]; 
inline void solve()
{
	int n,i,a; 
	scanf("%d",&n); 
	for(i=1;i<=n;++i) 
	{
		scanf("%d",&a); 
		if(S.find(a)==S.end()) printf("%d ",a), S.insert(a); 
	}
	S.clear(); 
	printf("\n"); 
}
int main()
{
	// setIO("input"); 
	int T; 
	scanf("%d",&T); 
	while(T--) solve(); 
	return 0; 
}

  

BZOJ 2761: [JLOI2011]不重复数字 set

原文:https://www.cnblogs.com/guangheli/p/11093406.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!