Cod sursa(job #2359300)

Utilizator TghicaGhica Tudor Tghica Data 28 februarie 2019 19:29:33
Problema Restante Scor 100
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.45 kb
#include <fstream>
#include <map>
#include <algorithm>
using namespace std;

map<string,int>map1;

int main()
{
    ifstream cin("restante.in");
    ofstream cout("restante.out");
    int n,k=0;
    string s;
    cin>>n;
    for(int i=1;i<=n;i++)
    {
        cin>>s;
        sort(s.begin(),s.end());
        map1[s]++;
        if(map1[s]==1)
            k++;
        if(map1[s]==2)
            k--;
    }
    cout<<k;
    return 0;
}