hdu1412

/**/
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cctype>
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <vector>
#include <string>
#include <stack>
#include <queue>

typedef long long LL;
using namespace std;

int n, m;

int main()
{
	//freopen("in.txt", "r", stdin);
	//freopen("out.txt", "w", stdout);

	while(scanf("%d %d", &n, &m) == 2){
		set<int>st;
		int x;
		for (int i = 1; i <= n; i++){
			scanf("%d", &x);
			st.insert(x);
		}
		for (int i = 1; i <= m; i++){
			scanf("%d", &x);
			st.insert(x);
		}

		set<int>::iterator it = st.begin();
		int flag = 0;
		for (; it != st.end(); it++){
			if(!flag){
				printf("%d", *it);
				flag = 1;
			}else{
				printf(" %d", *it);
			}
		}
		printf("\n");
	}

	return 0;
}
/**/

 

全部评论

相关推荐

之前自己不懂事,投了字节,基本是自己第一次面试,一面就挂了
观水:前几天有个学化学的做前端,加上实习面了22次字节最后成功了
点赞 评论 收藏
分享
ldyllic:飞神,985+美团+腾讯+京东,无敌飞飞神
点赞 评论 收藏
分享
想run的马里奥在学...:这个学历帮你扫平百分之80的障碍,投就完了,这会找不到就等3月暑期一样能找到
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务