Cod sursa(job #741421)

Utilizator alexalbu95Albu Alexandru alexalbu95 Data 25 aprilie 2012 23:22:32
Problema Restante Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.53 kb
#include <fstream>
#include <cstring>
#include <algorithm>

using namespace std;

ifstream f("restante.in");
ofstream g("restante.out");

static const int maxn=36005;

int n, i, nr;
string a[maxn];
char cuv[30];

int main()
{
    f>>n;
    f.get();
    for(i=1; i<=n; ++i)
    {
        f.get(cuv, 30);
        f.get();
        a[i]=cuv;
        sort( a[i].begin(), a[i].end() );
    }

    sort(a+1, a+n+1);

    for(i=1; i<=n; ++i)
        if(a[i] != a[i+1] && a[i] != a[i-1]) ++nr;

    g<<nr<<"\n";
}