Cod sursa(job #3153905)

Utilizator sorinturdaSorin Turda sorinturda Data 2 octombrie 2023 08:38:15
Problema Restante Scor 0
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.51 kb
//https://www.infoarena.ro/problema/restante
#include <bits/stdc++.h>

using namespace std;

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

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    int n;
    in >> n;
    // char s[n][17];
    set <char *> S;
    for (int i = 0; i < n; i++) {
        char t[17];
        in.getline(t, 17);
        sort(t, t + strlen(t));
        S.insert(t);
    }

    out << S.size() << '\n';


    in.close(), out.close();
    return 0;
}