Pagini recente » Cod sursa (job #1253861) | Cod sursa (job #3149723) | Cod sursa (job #523269) | Cod sursa (job #2979597) | Cod sursa (job #2540401)
#include <iostream>
#include <fstream>
#include <cstring>
#include <algorithm>
#include <map>
#define NMAX 36000
using namespace std;
ifstream f("restante.in");
ofstream g("restante.out");
int n;
char t[20];
string s[NMAX+10];
map <string, int> m;
int main()
{
f >> n;
for(int i=1; i<=n; i++)
{ f >> t;
int len = strlen(t);
sort(t, t+len);
for(int j=0; j<len; j++) s[i].push_back(t[j]);
}
int sol = n;
for(int i=1; i<=n; i++)
{ m[s[i]]++;
if(m[s[i]] == 2) sol -= 2;
else if(m[s[i]] > 2) sol--;
}
g << sol << '\n';
return 0;
}