Pagini recente » Cod sursa (job #1778708) | Cod sursa (job #1098162) | Cod sursa (job #1891620) | Cod sursa (job #1050612) | Cod sursa (job #1668144)
#include <stdio.h>
#include <cstring>
#define mod 666013
#define p 256
using namespace std;
int n,nr;
int fr[50];
char s[50];
short int hash1[mod+10];
int main()
{
freopen("restante.in","r",stdin);
freopen("restante.out","w",stdout);
scanf("%d ",&n); int nr=0;
for (int i=1;i<=n;i++) {
memset(fr,0,sizeof(fr));
gets(s+1); int m=strlen(s+1);
for (int j=1;j<=m;j++) fr[s[j]-97]++;
int curenthash=0;
for (int j=0;j<26;j++) curenthash=(curenthash*p+fr[j])%mod;
if (hash1[curenthash]==0) nr++;
if (hash1[curenthash]==1) nr--;
hash1[curenthash]++;
}
printf("%d",nr);
return 0;
}