Cod sursa(job #1811377)

Utilizator ciocan_catalinCiocan Catalin - Iulian ciocan_catalin Data 21 noiembrie 2016 10:21:03
Problema Restante Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.54 kb
#include <bits/stdc++.h>

using namespace std;
ifstream fin("restante.in");
ofstream fout("restante.out");
unordered_map < string, int> M;
int N,ans;

int main()
{
    int i,len;
    string x;
    fin >> N;
    for(i = 1; i <= N; i++)
    {
        fin >> x;
        sort(x.begin(),x.end());
        if(!M[x])
        {
            ++ans;
            M[x]++;
        }
        else
        {
            if(M[x] == 1)
                --ans;
            M[x]++;
        }
    }
    fout << ans << "\n";
    return 0;
}