Cod sursa(job #3258964)

Utilizator Maries_MihaiMaries Mihai Maries_Mihai Data 24 noiembrie 2024 15:18:06
Problema Restante Scor 100
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.59 kb
#include <fstream>
#include <algorithm>
#include <string>
#include <unordered_map>

std::ifstream fin("restante.in");
std::ofstream fout("restante.out");

std::unordered_map<std::string, int> mp;

int main()
{
    int n;
    int cate = 0;
    fin >> n;

    for (int i = 0; i < n; i++)
    {
        std::string word;
        fin >> word;
        std::sort(word.begin(), word.end());
        auto total = mp[word]++;
    }

    for (std::pair<std::string, int> pair : mp)
    {
        if (pair.second == 1)
            cate++;
    }

    fout << cate;

    return 0;
}