Pagini recente » Cod sursa (job #1281604) | Cod sursa (job #2507912) | Cod sursa (job #1085073) | Cod sursa (job #788959) | Cod sursa (job #654111)
Cod sursa(job #654111)
#include <fstream>
#include <algorithm>
using namespace std;
ifstream f("restante.in");
ofstream g("restante.out");
int n,i,sol=0;
string s[37000];
int main () {
f >> n;f.get();
for (i=1;i<=n;i++) {
f >> s[i];
sort(s[i].begin(),s[i].end());
}
sort(s+1,s+n+1);
s[0]='!';s[n+1]='!';
for (i=1;i<=n;i++)
if (s[i]!=s[i-1] && s[i]!=s[i+1]) sol++;
g << sol << '\n';
f.close();g.close();
return 0;
}