Pagini recente » Profil ubb_oprimabuzurile_2016 | Cod sursa (job #1559927) | Cod sursa (job #1612420) | Cod sursa (job #1226744) | Cod sursa (job #943884)
Cod sursa(job #943884)
#include <iostream>
#include <fstream>
#include <string>
#include <algorithm>
using namespace std;
ifstream in ("restante.in");
ofstream out ("restante.out");
typedef pair <string, string> PSS;
PSS S[4010];
inline bool comp (const PSS &A, const PSS &B)
{
return A.first < B.first;
}
int main()
{
int N, i, j, Ans = 0, now = 1;
in >> N;
for (i = 1; i <= N; i ++){
in >> S[i].first;
S[i].second = S[i].first;
sort (S[i].first.begin (), S[i].first.end ());
}
sort (S + 1, S + N + 1, comp);
for (i = 1; i <= N; i ++){
if (S[i].first == S[i + 1].first)
now ++;
else{
if (now == 1)
Ans ++;
now = 1;
}
}
out << Ans;
return 0;
}