标签:
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1412
Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 14595 Accepted Submission(s):
6095
1 #include <iostream> 2 #include <cstdio> 3 #include <algorithm> 4 5 using namespace std; 6 7 int num[10010+10000]; 8 9 int main () 10 { 11 int n,m; 12 while (~scanf("%d%d",&n,&m)) 13 { 14 for (int i=0; i<n+m; i++) 15 { 16 scanf("%d",&num[i]); 17 } 18 sort(num,num+n+m); 19 for (int i=0; i<n+m; i++) 20 { 21 if (i==0) 22 { 23 printf ("%d",num[0]); 24 continue; 25 } 26 if (num[i]==num[i-1]) 27 continue; 28 else 29 printf (" %d",num[i]); 30 } 31 printf ("\n"); 32 } 33 return 0; 34 }
标签:
原文地址:http://www.cnblogs.com/qq-star/p/4622935.html