1000A Codeforces - Codehorses T-shirts





Solution in c++

#include <iostream>
#include <map>
#include <cmath>
#include <cstdio>

using namespace std;

typedef long long int lli;

lli n,acc,sol;
string inp;
map<string,int> sizes;

int main()
{

    scanf("%lld" , & n);

    for(int i=0;i<n;i++)
    {
        cin>>inp;
        sizes[inp]++;
        acc++;
    }

    while(n--)
    {
        cin>>inp;
            sizes[inp]--;
            acc--;
    }
    
for(auto u : sizes)sol+=abs(u.second);
    
    printf("%lld" , sol/2);

}

Share on Google Plus

About Mohamed Sobhi

My name is Mo.Sobhy ,I study at School excelling high school in Ain Shams ,Cairo
My hobbies is programming ,and web development ,playing chess and writing horror stories.
    Blogger Comment
    Facebook Comment

0 التعليقات:

إرسال تعليق