Cod sursa(job #2355023)

Utilizator bitonekoTraian Omin bitoneko Data 25 februarie 2019 19:16:19
Problema Restante Scor 100
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.67 kb
#include <fstream>
#include <map>
#include <algorithm>
using namespace std;
ifstream cin("restante.in");
ofstream cout("restante.out");
map<string,bool>v;
int main()
{
    string c;
    int n;
    cin >> n;
    for (int i=0; i<n; i++)
    {
        cin >> c;
        sort(c.begin(),c.end());
        if(v.find(c)!=v.end())
        {
            v[c]=1;
        }
        if(v.find(c)==v.end())
        {
            v[c]=0;
        }
    }
    int cnt=0;
    map<string,bool>::iterator it;
    for (it = v.begin(); it!=v.end(); it++)
    {
        if (it->second == 0)
        {
            cnt++;
        }
    }
    cout << cnt;
    return 0;
}