Cod sursa(job #1657968)

Utilizator robertkarolRobert Szarvas robertkarol Data 20 martie 2016 22:18:16
Problema Restante Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.5 kb
#include <iostream>
#include <fstream>
#include <algorithm>
#include <string>
using namespace std;
ifstream fin("restante.in");
ofstream fout("restante.out");
int n,k,i,j,sw;
//char s[36001][17];
string s[36001];
int main()
{
    fin>>n;
    for(i=1;i<=n;i++)
    {
        fin>>s[i];
        sort(s[i].begin(),s[i].end());
        //cout<<0<<s[i];
    }
    sort(s+1,s+n+1);
    for(i=1;i<=n;i++)
    {
        if(s[i-1]!=s[i]&&s[i+1]!=s[i]) k++;
    }
    fout<<k;
    return 0;
}