Language: C++

#include <bits/stdc++.h>
using namespace std;

void solve(long long N, std::vector<std::string> s){
    long long result = 0LL;
    unordered_map<string, int> cache;
    // unordered_map<string, string> cache;
    for(int n = s.size(), i=n-1; i>=0; --i){
        vector<int> chars(26, 0);
        for (auto& c: s[i]){
            chars[c-'a']++;
        }
        string tmp;
        for (int i=0;i<26; ++i){
            if (chars[i]!=0){
                tmp += to_string() + "_";
            }
        }
        
        result += cache[tmp];
        cache[tmp]+=1;
        // no need to keep s[i], we just want to know the size
        // result += cache[tmp].size();
        // cache[tmp].push_back(s[i]);
    }
    printf("%lld", result);
}

// Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    long long N;
    scanf("%lld",&N);
    std::vector<std::string> s(N);
    for(int i = 0 ; i < N ; i++){
        std::cin >> s[i];
    }
    solve(N, std::move(s));
    return 0;
}


Compiler output:
a.cc: In function 'void solve(long long int, std::vector<std::__cxx11::basic_string<char> >)':
a.cc:16:33: error: no matching function for call to 'to_string()'
   16 |                 tmp += to_string() + "_";
      |                        ~~~~~~~~~^~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:4240:3: note: candidate: 'std::string std::__cxx11::to_string(int)'
 4240 |   to_string(int __val)
      |   ^~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:4240:3: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/basic_string.h:4259:3: note: candidate: 'std::string std::__cxx11::to_string(unsigned int)'
 4259 |   to_string(unsigned __val)
      |   ^~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:4259:3: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/basic_string.h:4275:3: note: candidate: 'std::string std::__cxx11::to_string(long int)'
 4275 |   to_string(long __val)
      |   ^~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:4275:3: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/basic_string.h:4294:3: note: candidate: 'std::string std::__cxx11::to_string(long unsigned int)'
 4294 |   to_string(unsigned long __val)
      |   ^~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:4294:3: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/basic_string.h:4310:3: note: candidate: 'std::string std::__cxx11::to_string(long long int)'
 4310 |   to_string(long long __val)
      |   ^~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:4310:3: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/basic_string.h:4327:3: note: candidate: 'std::string std::__cxx11::to_string(long long unsigned int)'
 4327 |   to_string(unsigned long long __val)
      |   ^~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:4327:3: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/basic_string.h:4401:3: note: candidate: 'std::string std::__cxx11::to_string(float)'
 4401 |   to_string(float __val)
      |   ^~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:4401:3: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/basic_string.h:4411:3: note: candidate: 'std::string std::__cxx11::to_string(double)'
 4411 |   to_string(double __val)
      |   ^~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:4411:3: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/basic_string.h:4421:3: note: candidate: 'std::string std::__cxx11::to_string(long double)'
 4421 |   to_string(long double __val)
      |   ^~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:4421:3: note:   candidate expects 1 argument, 0 provided