码迷,mamicode.com
首页 > 其他好文 > 详细

UCF “Practice” Local Contest — Aug 25, 2018 Boots Exchange 水题

时间:2020-04-05 13:33:18      阅读:70      评论:0      收藏:0      [点我收藏+]

标签:cin   c++   using   pre   bsp   png   技术   cal   color   

技术图片

 

 

 

#include <bits/stdc++.h>
using namespace std;

int n;
set <int> a;
map <int,int> cnt;

int main()
{
    cin >> n; int ans = 0;
    for (int i = 1; i <= n; ++i) 
    {
        int x; cin >> x; 
        a.insert(x);
        ++cnt[x];
    }
    for (int i = 1; i <= n; ++i)
    {
        int x; cin >> x;
        if(a.count(x) && cnt[x]) --cnt[x];
        else ans++;
    }
    cout << ans << endl;
    return 0;
}

 

UCF “Practice” Local Contest — Aug 25, 2018 Boots Exchange 水题

标签:cin   c++   using   pre   bsp   png   技术   cal   color   

原文地址:https://www.cnblogs.com/2aptx4869/p/12636603.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!