hdu 5058 set应用
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应用的更多相关文章
- BestCoder12 1001.So easy(hdu 5058) 解题报告
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5058 (格式有点问题,为了方便阅读---整个复制下来吧) 题目意思:给出两个长度都为 n 的集合你,问 ...
- hdu 5058 So easy
题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=5058 So easy Description Small W gets two files. Ther ...
- [kmp+dp] hdu 4628 Pieces
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=4622 Reincarnation Time Limit: 6000/3000 MS (Java/Ot ...
- HDOJ 2111. Saving HDU 贪心 结构体排序
Saving HDU Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total ...
- 【HDU 3037】Saving Beans Lucas定理模板
http://acm.hdu.edu.cn/showproblem.php?pid=3037 Lucas定理模板. 现在才写,noip滚粗前兆QAQ #include<cstdio> #i ...
- hdu 4859 海岸线 Bestcoder Round 1
http://acm.hdu.edu.cn/showproblem.php?pid=4859 题目大意: 在一个矩形周围都是海,这个矩形中有陆地,深海和浅海.浅海是可以填成陆地的. 求最多有多少条方格 ...
- HDU 4569 Special equations(取模)
Special equations Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u S ...
- HDU 4006The kth great number(K大数 +小顶堆)
The kth great number Time Limit:1000MS Memory Limit:65768KB 64bit IO Format:%I64d & %I64 ...
- HDU 1796How many integers can you find(容斥原理)
How many integers can you find Time Limit:5000MS Memory Limit:32768KB 64bit IO Format:%I64d ...
随机推荐
- get(0).tagName获得作用标签
<script type="text/javascript" src="jquery1.4.js"></script><scrip ...
- BZOJ1999或洛谷1099&BZOJ2282或洛谷2491 树网的核&[SDOI2011]消防
一道树的直径 树网的核 BZOJ原题链接 树网的核 洛谷原题链接 消防 BZOJ原题链接 消防 洛谷原题链接 一份代码四倍经验,爽 显然要先随便找一条直径,然后直接枚举核的两个端点,对每一次枚举的核遍 ...
- Linux 内核态与用户态通信 netlink
参考资料: https://blog.csdn.net/zqixiao_09/article/details/77131283 https://www.cnblogs.com/lopnor/p/615 ...
- UI设计师经常去的五个网站
1.站酷 站酷(ZCOOL),中国人气设计师互动平台.深耕设计领域十年,站酷聚集了470万优秀设计师.摄影师.插画师.艺术家.创意人,设计创意群体中具有较高的影响力与号召力. 2.花瓣 花瓣网, ...
- 数据结构:链表 >> 链表按结点中第j个数据属性排序(冒泡排序法)
创建结点类,链表类,测试类 import java.lang.Object; //结点node=数据date+指针pointer public class Node { Object iprop; p ...
- Maximum Average Subarray I LT643
Given an array consisting of n integers, find the contiguous subarray of given length k that has the ...
- IOS初级:AFNetworking
狗 日的,第三方框架真j8难搞 1.为什么NS_ASSUME_NONNULL_BEGIN在6.2报错,你他么的还挑IDE,你这是什么态度? 2.还有,你他么的自动给老子转json了,有问过我么? #i ...
- Python 中Lambda 表达式 实例解析
Lambda 表达式 lambda表达式是一种简洁格式的函数.该表达式不是正常的函数结构,而是属于表达式的类型.而且它可以调用其它函数. 1.基本格式: lambda 参数,参数...:函数功能代码 ...
- linux关机命令-shutdown
shutdown1.作用shutdown命令的作用是关闭计算机.root用户关机时,不管是否还有其他登录用户,都会关机:如果是非root用户关机,如果还有其他的登录用户,将会提示不能关机.2.格式sh ...
- 2019.01.22 hdu5195 DZY Loves Topological Sorting(贪心+线段树)
传送门 题意简述:给出一张DAGDAGDAG,要求删去不超过kkk条边问最后拓扑序的最大字典序是多少. 思路:贪心帮当前不超过删边上限且权值最大的点删边,用线段树维护一下每个点的入度来支持查询即可. ...