题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2034

解题思路:set的基本用法

 #include<iostream>
#include<string.h>
#include<stdio.h>
#include<set>
using namespace std; int main()
{
int num1,num2,n;
while(scanf("%d %d",&num1,&num2)!=EOF)
{
if(num1 == && num2 == )
break;
else
{ set<int> set1;
set1.clear();
for(int i=;i<num1;i++)
{
cin>>n;
set1.insert(n);
} for(int i=;i<num2;i++)
{
cin>>n;
set1.erase(n);
} if(set1.size()!=)
{ set<int>::iterator it=set1.begin(); for(;it!=set1.end();it++)
{
cout<<*it<<" "; }
cout<<endl;
} else
cout<<"NULL\n"; } }
return ;
}

hdu 2034人见人爱A-B的更多相关文章

  1. hdu 2034 人见人爱A-B

    题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=2034 人见人爱A-B Description 参加过上个月月赛的同学一定还记得其中的一个最简单的题目, ...

  2. HDU 2034 人见人爱A-B 分类: ACM 2015-06-23 23:42 9人阅读 评论(0) 收藏

    人见人爱A-B Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Su ...

  3. HDU 2034 人见人爱A-B【STL/set】

    人见人爱A-B Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Sub ...

  4. 杭电 2034 人见人爱A-B

    http://acm.hdu.edu.cn/showproblem.php?pid=2034 人见人爱A-B Time Limit: 2000/1000 MS (Java/Others)    Mem ...

  5. hdu 2035 人见人爱A^B

    题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=2035 人见人爱A^B Description 求A^B的最后三位数表示的整数.说明:A^B的含义是“A ...

  6. HDU 2035 人见人爱A^B 分类: ACM 2015-06-22 23:54 9人阅读 评论(0) 收藏

    人见人爱A^B Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Su ...

  7. 杭电2034——人见人爱A-B

    #include <stdio.h> #include <algorithm> using namespace std; int main () { int a[110],b[ ...

  8. HDU 2033 人见人爱A+B

    http://acm.hdu.edu.cn/showproblem.php?pid=2033 Problem Description HDOJ上面已经有10来道A+B的题目了,相信这些题目曾经是大家的 ...

  9. HDU 2035.人见人爱A^B-快速幂

    人见人爱A^B Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Sub ...

随机推荐

  1. iOS开发——UI基础-懒加载,plist文件,字典转模型,自定义view

    一.懒加载 只有使用到了商品数组才会创建数组 保证数组只会被创建一次 只要能够保证数组在使用时才创建, 并且只会创建一次, 那么我们就称之为懒加载 lazy - (void)viewDidLoad 控 ...

  2. leetcode 102. Binary Tree Level Order Traversal

    Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, ...

  3. OpenGL基础图形的绘制

    例一:绘制五角星 设五角星5个顶点分别为ABCDE,顶点到坐标轴原点距离为r,ABCDE各点用r表示,分别为 A(0,r); B(-r*sin(2/5*Pi),r*cos(2/5*Pi)); C(-r ...

  4. 编码(Code)

    很遗憾,直接搜索Code或者编码是很难得找到这本书的,我也是无意中才接触到本书. 第一次读本书,对各方面的知识都不算很懂,觉得很多地方都写的太多浅显,好像本该就是这样子,一个编码系统说的那么麻烦干嘛, ...

  5. (转)Singleton 单例模式(懒汉方式和饿汉方式)

    原文地址:http://www.cnblogs.com/kkgreen/archive/2011/09/05/2166868.html 单例模式的概念: 单例模式的意思就是只有一个实例.单例模式确保某 ...

  6. jQuery lazyload插件详解和问题解答

    lazyload插件用于图片延迟加载,节省服务器带宽,减少服务器请求次数,提高网站的页面加载速度,用于网站性能优化,只有当图片在窗口可视范围内时才向服务器请求: 参数: threshold:设置距离窗 ...

  7. 【leetcode】Search a 2D Matrix

    Search a 2D Matrix Write an efficient algorithm that searches for a value in an m x n matrix. This m ...

  8. fork详解

    [本文链接] http://www.cnblogs.com/hellogiser/p/fork.html [代码] 下面的代码输出多少个-?  C++ Code  123456789101112131 ...

  9. java.lang.UnsatisfiedLinkError: Couldn't load hyphenate_av from loader dalvik.system.PathClassLoader

    android studio引入第三方库时报如下异常. 06-15 16:50:24.477 9497-9497/easemobim.test.com.easemobim E/AndroidRunti ...

  10. java学习笔记--IO流

    第十二章大纲: I/O input/output 输入/输出 一.创建文件,借助File类来实现 file.createNewFile() : 创建文件 file.exists() : 判断文件是否存 ...