zoukankan      html  css  js  c++  java
  • L1-1 帅到没朋友 (20分)

    L1-1 帅到没朋友 (20分)

    #include<iostream>
    #include<vector>
    #include<algorithm>
    #include<string>
    #include<map>
    #include<set>
    #include<cstring>
    using namespace std;
    #define STDIN freopen("in.in", "r", stdin);freopen("out.out", "w", stdout);
    
    int main()
    {
    //     STDIN
        int n; cin >> n;
        map<string, bool > ma;
        set<string> se;
        for (int i = 1; i <= n; i++)
        {
            int m;
            cin >> m;
            for (int i = 1; i <= m; i++)
            {
                string s;
                cin >> s;
                if (m >= 2){
                    ma[s] = true;
                }
            }
        }
        cin >> n;
        vector<string> ans;
        se.clear();
        for (int i = 1; i <= n; i++)
        {
            string s; cin>>s;
            if (ma.count(s) == 0 && se.find(s) == se.end()) ans.push_back(s),se.insert(s);
            if (ma.count(s) && ma[s] == false && se.find(s) == se.end()) ans.push_back(s),se.insert(s);
        }
        int len = ans.size();
        if (len == 0) {
            puts("No one is handsome");return 0;
        }
        for (int i = 0; i < len ;i++)
        {
            cout << ans[i];
            if (i == len - 1) cout << endl;
            else cout << " ";
        }
    }
  • 相关阅读:
    代码希望HTML5初探CSS3新特性小示例
    myeclipse及eclipse的优化
    window7如何提高到最高权限
    大麦茶
    poj3292
    poj3278
    poj3100
    poj3117
    poj3299
    Presto性能调优的五大技巧
  • 原文地址:https://www.cnblogs.com/hulian425/p/14030879.html
Copyright © 2011-2022 走看看