Cod sursa(job #2345293)

Utilizator isa_tudor_andreiAndrei Tudor isa_tudor_andrei Data 16 februarie 2019 10:14:33
Problema Restante Scor 100
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.51 kb
#include <iostream>
#include <string>
#include <algorithm>
#include <unordered_map>
#define NMAX 36005

using namespace std;

unordered_map <string,int> v;
string s;

int main() {
    freopen("restante.in","r",stdin);
    freopen("restante.out","w",stdout);
    int n,i,j;
    cin>>n;
    for( i = 1; i <= n; i ++ ) {
      cin>>s;
      sort(s.begin(),s.end());
      v[s] ++;
    }
    j = 0;
    for( const auto &m : v )
      if( m.second == 1 )
        j ++;
    cout<<j;
    return 0;
}