hdu 5058 So easy
2015-07-04 19:40
267 查看
给出2个集合,让你判断是否相等
方法很多,我用map;
方法很多,我用map;
#include<iostream> #include<map> using namespace std; map<int,int>mapp; map<int,int>mappp; int main() { int n; while(cin>>n) { mapp.clear(); mappp.clear(); for(int i=0;i<n;i++) { int x; cin>>x; if(mapp.find(x)==mapp.end()) mapp[x]=1; } int sum=0; for(int i=0;i<n;i++) { int x; cin>>x; if(mappp.find(x)==mappp.end()) mappp[x]=1; } if(mapp==mappp) cout<<"YES"<<endl; else cout<<"NO"<<endl; } return 0; }
相关文章推荐
- 括号配对问题
- socket编程
- CF 557C(Arthur and Table-直接暴力)
- GRBL八:STM32代码移植——串口
- Qt上第三方串口类QExtSerialPort的使用
- JAVA图形编程Swing之——JPanel绘图
- 使用指针方式进行数组排序 选择排序:
- Debian7离线升级bash漏洞—然后修复方法
- Java设计模式之单例模式k
- codeforces B. School Marks
- node C++扩展(2) 尝试翻译node官网文档
- Android优化之ViewStub
- MeteoInfoLab脚本示例:FY-3A AOD HDF数据
- 漫谈程序员系列:怎么告别“混日子”
- redhat5.5 openldap server 配置搭建
- JAVA常用类之——System和Runtime
- [leetcode] Subsets II
- C++ 中string.find() 函数的用法总结(转载)
- 结束?开始。
- LTE演进路线图