hdu 2034人见人爱A-B
题目链接: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的更多相关文章
- hdu 2034 人见人爱A-B
题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=2034 人见人爱A-B Description 参加过上个月月赛的同学一定还记得其中的一个最简单的题目, ...
- 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 ...
- HDU 2034 人见人爱A-B【STL/set】
人见人爱A-B Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Sub ...
- 杭电 2034 人见人爱A-B
http://acm.hdu.edu.cn/showproblem.php?pid=2034 人见人爱A-B Time Limit: 2000/1000 MS (Java/Others) Mem ...
- hdu 2035 人见人爱A^B
题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=2035 人见人爱A^B Description 求A^B的最后三位数表示的整数.说明:A^B的含义是“A ...
- 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 ...
- 杭电2034——人见人爱A-B
#include <stdio.h> #include <algorithm> using namespace std; int main () { int a[110],b[ ...
- HDU 2033 人见人爱A+B
http://acm.hdu.edu.cn/showproblem.php?pid=2033 Problem Description HDOJ上面已经有10来道A+B的题目了,相信这些题目曾经是大家的 ...
- HDU 2035.人见人爱A^B-快速幂
人见人爱A^B Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Sub ...
随机推荐
- laravel打印sql语句
打印sql语句,直接在你执行SQL语句后输出 方法一: $queries = DB::getQueryLog(); $a = end($queries); $tmp = str_replace('?' ...
- Codeforces Gym 100114 D. Selection
Description 问选择一个序列上的所有数的最少操作次数,跟电脑上选择文件一样,输出操作方案. Sol 贪心. 用Shift一段文件只能使用一次,之后必须一直按Ctrl了. 然后就是看用Shif ...
- IDEA 新建文件默认加入CVS
是要先add,不过可以设置创建的文件都默认 add的.修改默认值看下图:打开系统设置,找到 Version Control 设置选项: 在 When files are created 选项中选择第二 ...
- 腾讯云环境配置之PHP5.6.3 + redis扩展 稳定版
腾讯云环境配置之PHP5.6.3 + redis扩展 稳定版 时间:2015-01-18 01:41来源:linux.it.net.cn 作者:IT #由于上文装过yum groupinstall ...
- PHP 常量
1.__NAMESPACE__ http://php.net/manual/zh/language.namespaces.nsconstants.php
- DataTable得到某行某列的值
DataTable dt=this.GetRepeatTableData("repeating1"); int count=dt.Rows.Count;for(int x=0;x& ...
- Python之异常追踪模块:traceback
正常时输出追踪信息: import traceback def stack(): print 'The python stack:' traceback.print_stack() from twis ...
- Linux安装字体
用惯了Win7的字体,感觉雅黑看着很舒服,就动手在Linux安装下,简单描述下: 第一步:百度一下,找到微软雅黑字体(.ttf)下载 第二步:把下载的字体放到cd /usr/share/fonts/z ...
- Gitlab的Gravatar头像无法显示的问题
通过gitlab搭建的git仓库,由于Gravatar被墙了,导致Gravatar头像无法显示.总觉得怪怪的. 社区版gitlab解决办法: vi /var/opt/gitlab/gitlab-rai ...
- Effective C++ -----条款20:宁以pass-by-reference-to-const替换pass-by-value Prefer pass-by-reference-to-const to pass-by-value
尽量以pass-by-reference-to-const替换pass-by-value.前者通常比较高校,并可避免切割问题(slicing problem). 以上规则并不适用于内置类型,以及STL ...