• 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;
     }

  • 相关阅读:
    css 面试学习
    关于CSS的图像放大问题的解决,需要借助jQuery等直接用css3设置
    DEBUG使用
    crontab
    od
    dumpe2fs
    mke2fs
    dd
    GDB
    rm
  • 原文地址:https://www.cnblogs.com/zibaohun/p/4046776.html
Copyright © 2020-2023  润新知