Pagini recente » Cod sursa (job #180376) | Cod sursa (job #1798581) | Cod sursa (job #2137270) | Cod sursa (job #1819737) | Cod sursa (job #3137180)
#include <fstream>
#include <algorithm>
#include <string.h>
using namespace std;
ifstream in("restante.in");
ofstream out("restante.out");
char m[36002][17];
int v[36002];
bool cmp2(int a, int b)
{
if(strcmp(m[a], m[b])<0)
{
return 0;
}
return 1;
}
int main()
{
for(int i=1; i<=36000; i++)
{
v[i]=i;
}
char l;
int n, r=0;
in>>n;
for(int i=1; i<=n; i++)
{
in>>m[i];
l=strlen(m[i]);
sort(m[i]+0, m[i]+l);
}
sort(v+1, v+n+1, cmp2);
for(int i=1; i<=n; i++)
{
if(strcmp(m[v[i]], m[v[i-1]])!=0 && strcmp(m[v[i]], m[v[i+1]])!=0)
{
r++;
}
}
out<<r;
}