http://acm.hdu.edu.cn/showproblem.php?pid=5058

set应用

水题

#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <string>
#include <queue>
#include <set>
#include <iostream>
#include <algorithm>
using namespace std;
#define RD(x) scanf("%d",&x)
#define RD2(x,y) scanf("%d%d",&x,&y)
#define clr0(x) memset(x,0,sizeof(x))
typedef long long LL;
set<int> s1,s2;
int x,n;
void work()
{
s1.clear();s2.clear();
for(int i = 0;i < n;++i){
RD(x);
s1.insert(x);
}
for(int i = 0;i < n;++i){
RD(x);
s2.insert(x);
}
set<int>::iterator it1,it2;
for(it1 = s1.begin(),it2 = s2.begin();it1 != s1.end(),it2 != s2.end();it1++,it2++){
if(*it1 != *it2){
puts("NO");
return;
}
}
if(it1 != s1.end() || it2 != s2.end())
puts("NO");
else
puts("YES");
}
int main(){
while(~RD(n)){
work(); }
return 0;
}

hdu 5058 set应用的更多相关文章

  1. BestCoder12 1001.So easy(hdu 5058) 解题报告

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5058 (格式有点问题,为了方便阅读---整个复制下来吧) 题目意思:给出两个长度都为 n 的集合你,问 ...

  2. hdu 5058 So easy

    题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=5058 So easy Description Small W gets two files. Ther ...

  3. [kmp+dp] hdu 4628 Pieces

    题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=4622 Reincarnation Time Limit: 6000/3000 MS (Java/Ot ...

  4. HDOJ 2111. Saving HDU 贪心 结构体排序

    Saving HDU Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total ...

  5. 【HDU 3037】Saving Beans Lucas定理模板

    http://acm.hdu.edu.cn/showproblem.php?pid=3037 Lucas定理模板. 现在才写,noip滚粗前兆QAQ #include<cstdio> #i ...

  6. hdu 4859 海岸线 Bestcoder Round 1

    http://acm.hdu.edu.cn/showproblem.php?pid=4859 题目大意: 在一个矩形周围都是海,这个矩形中有陆地,深海和浅海.浅海是可以填成陆地的. 求最多有多少条方格 ...

  7. HDU 4569 Special equations(取模)

    Special equations Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u S ...

  8. HDU 4006The kth great number(K大数 +小顶堆)

    The kth great number Time Limit:1000MS     Memory Limit:65768KB     64bit IO Format:%I64d & %I64 ...

  9. HDU 1796How many integers can you find(容斥原理)

    How many integers can you find Time Limit:5000MS     Memory Limit:32768KB     64bit IO Format:%I64d ...

随机推荐

  1. BZOJ1999或洛谷1099&BZOJ2282或洛谷2491 树网的核&[SDOI2011]消防

    一道树的直径 树网的核 BZOJ原题链接 树网的核 洛谷原题链接 消防 BZOJ原题链接 消防 洛谷原题链接 一份代码四倍经验,爽 显然要先随便找一条直径,然后直接枚举核的两个端点,对每一次枚举的核遍 ...

  2. C++/CLI学习入门

    aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAxIAAAFlCAYAAAB/fN6bAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjw

  3. 小话C源码移植

    我们知道国外很多程序员工作在linux / unix 环境下,所以有很多优秀的c/c++语言代码不能直接在windows平台进行编译. 很多时候我们只能使用msys, cmake等工具进行模拟环境编译 ...

  4. [Hbase]Hbase知识大全

    HBase简介 是一个构建在HDFS上的分布式列存储系统:HBase是基于Google BigTable模型开发的,典型的key/value系统:HBase是Apache Hadoop生态系统中的重要 ...

  5. mysql完装成功后的提示。

    To start mysqld at boot time you have to copysupport-files/mysql.server to the right place for your ...

  6. Angular的一些用法或者结构技巧

    如果有更好的方式,请留言交流: 2017-07-07 多个controller共用一个函数.在$rootScope中定义方法, $rootScope.share_fun = function test ...

  7. 开发apicloud模块遇到的几个梗

    2017-06-04 原来模块中不能的R.id.xxx,只能用UZResourcesIDFinder.getResIdID("mo_minivr_framecontainer") ...

  8. 查询数据库中的表格---通过构造方法将数据存入到List集合中---遍历进行输出

    package cn.jy.demo; import java.sql.Connection;import java.sql.PreparedStatement;import java.sql.Res ...

  9. 【Linux】Jenkins+Git源码管理(三)

    摘要 本章介绍Jenkins配合Git源码管理,关于Jenkins的基本操作,参照[Linux]Jenkins配置和使用(二) 事例说明:在linux环境下,安装的jenkins,已安装git. 代码 ...

  10. 20155312 2016-2017-2 《Java程序设计》第七周学习总结

    20155312 2016-2017-2 <Java程序设计>第七周学习总结 课堂内容总结 read()每次读入一个字节. eg:short2个字节,2=0x0201,读入后要0x < ...