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. 百度云的ubuntu16.04.1部署Apache服务器+Django项目

    使用Apache和mod_wsgi部署Django 是一种久经考验的将Django投入生产的方法. mod_wsgi是一个Apache模块,可以托管任何Python WSGI应用程序,包括Django ...

  2. c sharp multithreading

    1.  静态方法 using System; using System.Threading; namespace PlusThread { class Program { static void Ma ...

  3. Spring IOC(四)FactoryBean

    Spring IOC(四)FactoryBean Spring 系列目录(https://www.cnblogs.com/binarylei/p/10198698.html) 一般情况下,Spring ...

  4. MD5加密及Hash长度拓展攻击【通俗易懂】

    先放一个简单点的利用了Hash长度拓展攻击的题目 if($COOKIE["getmein"] === md5($secret . urldecode($username . $pa ...

  5. [ES]elasticsearch章4 ES的META们

    在介绍Meta更新流程前,我们先介绍一下ES中Meta的组成.存储方式和恢复方式. 1. Meta:ClusterState.MetaData.IndexMetaData Meta是用来描述数据的数据 ...

  6. 生活类App原型制作分享-AnyList

    AnyList是一款可以帮你创建购物清单,并且帮助你整理食谱的生活工具App,前面引导页采用图片+文字的方式,介绍App的用法,登录注册采用选项卡切换的方式,减少了页面切换的繁琐操作,在Mockplu ...

  7. IOS语法

    2017-07-15 NSDictionary里要用到的类型转换   [NSNumber numberWithInt: 89] 2017-12-10 定义一个Block的写法 typedef void ...

  8. php服务器---IIS一些问题

    配置网上很多博客都介绍过..这里不作详细说明了..将PHP目录(D:\PHP\PHP)下的php.ini-recommended或者php.ini-dist改名为php.ini,并找到extensio ...

  9. 《团队-爬取豆瓣电影TOP250-设计文档》

    搭建环境: 1.安装python3.4 2.安装pycharm集成开发环境 3.安装Git for Windows 4.安装python第三方包 bs4开发阶段: 1.团队成员申请并配置github账 ...

  10. tms web core 通过URL 传递参数

    一般我们都会通过URL 给服务器传递很多参数,通过参数来决定对应的处理,今天就大概讲一下 如果通过URL 参数实现一些功能. 1.通过参数跳入不同的界面 首先我们先建立一个tms web core 工 ...