[AtCoder Beginner Contest 091]B - Two Colors Card Game(STL map)

题目链接:https://abc091.contest.atcoder.jp/tasks/abc091_b

 

    #include <iostream>
    #include <map>
    using namespace std;
    int n, m, mx;
    string s[105], t;
    map<string, int> mp;
    int main() {
        int i;
        cin>>n;
        for(i=0; i<n; i++) cin>>s[i], mp[s[i]]++;
        cin>>m;
        while(m--) cin>>t, mp[t]--;
        for(i=0; i<n; i++) mx = max(mx, mp[s[i]]);
        cout<<mx;
        return 0;
    }
View Code

 

posted @ 2018-03-27 11:35  Somnus、M  阅读(111)  评论(0编辑  收藏  举报