Pagini recente » Cod sursa (job #1276096) | Cod sursa (job #734018) | Cod sursa (job #2791129) | Cod sursa (job #940728) | Cod sursa (job #473577)
Cod sursa(job #473577)
#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
const char in[]="restante.in", out[]="restante.out";
struct cuv{ char c[17];bool x;}v[36000];
struct cmp{
bool operator()(const char &a, const char &b)
{
return a<b;
}
};
struct cmp1{
bool operator()(const cuv &a, const cuv &b)
{
return strcmp(a.c, b.c) < 0;
}
};
int main()
{
freopen(in,"r",stdin);
freopen(out,"w",stdout);
int n;
scanf("%d\n", &n);
int s = 0;
for(int i = 0; i < n; ++i)
{
scanf("%s\n", v[i].c);
sort(v[i].c, v[i].c + strlen(v[i].c), cmp());
}
sort(v, v+n, cmp1());
for(int i = 0; i < n; ++i)
{if(!strcmp(v[i].c, v[i+1].c))v[i].x=1, v[i+1].x=1;
if(v[i].x)--s;}
printf("%d\n", s);
return 0;
}