Language: C++

#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i,s,n) for(int i = s; i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(n) (n).begin(), (n).end()
#define RALL(n) (n).rbegin(), (n).rend()
#define ATYN(n) cout << ( (n) ? "Yes":"No") << endl;
#define CFYN(n) cout << ( (n) ? "YES":"NO") << endl;
using ll = long long;
using ull = unsigned long long;


int main(void)
{
    IOS
    int n; cin >> n;
    vector<string> v(n);
    map<string,ll> m;
    REP(i,n)  {
        cin >> v[i];
        sort(ALL(v[i]));
    }
    
    sort(ALL(v));

    REP(i,n) {
        if (m.find(ALL(m),m[v[i]]) == m.end()) {
            m[v[i]] = 0;
        } else {
            m[v[i]] += m[v[i]] + 1;
        }

    }

    ll ans = accumulate(ALL(m),0LL);
    cout << ans << endl;


    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:19: error: no matching function for call to 'std::map<std::__cxx11::basic_string<char>, long long int>::find(std::map<std::__cxx11::basic_string<char>, long long int>::iterator, std::map<std::__cxx11::basic_string<char>, long long int>::iterator, std::map<std::__cxx11::basic_string<char>, long long int>::mapped_type&)'
   28 |         if (m.find(ALL(m),m[v[i]]) == m.end()) {
      |             ~~~~~~^~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/map:63,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:152,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_map.h:1224:9: note: candidate: 'template<class _Kt> decltype (((std::map<_Key, _Tp, _Compare, _Alloc>*)this)->std::map<_Key, _Tp, _Compare, _Alloc>::_M_t._M_find_tr(__x)) std::map<_Key, _Tp, _Compare, _Alloc>::find(const _Kt&) [with _Key = std::__cxx11::basic_string<char>; _Tp = long long int; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, long long int> >]'
 1224 |         find(const _Kt& __x) -> decltype(_M_t._M_find_tr(__x))
      |         ^~~~
/usr/include/c++/14/bits/stl_map.h:1224:9: note:   candidate expects 1 argument, 3 provided
/usr/include/c++/14/bits/stl_map.h:1249:9: note: candidate: 'template<class _Kt> decltype (((const std::map<_Key, _Tp, _Compare, _Alloc>*)this)->std::map<_Key, _Tp, _Compare, _Alloc>::_M_t._M_find_tr(__x)) std::map<_Key, _Tp, _Compare, _Alloc>::find(const _Kt&) const [with _Key = std::__cxx11::basic_string<char>; _Tp = long long int; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, long long int> >]'
 1249 |         find(const _Kt& __x) const -> decltype(_M_t._M_find_tr(__x))
      |         ^~~~
/usr/include/c++/14/bits/stl_map.h:1249:9: note:   candidate expects 1 argument, 3 provided
/usr/include/c++/14/bits/stl_map.h:1218:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::iterator std::map<_Key, _Tp, _Compare, _Alloc>::find(const key_type&) [with _Key = std::__cxx11::basic_string<char>; _Tp = long long int; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, long long int> >; iterator = std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, long long int>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, long long int> >, std::less<std::__cxx11::basic_string<char> >, std::allocator<std::pair<const std::__cxx11::basic_string<char>, long long int> > >::iterator; key_type = std::__cxx11::basic_string<char>]'
 1218 |       find(const key_type& __x)
      |       ^~~~
/usr/include/c++/14/bits/stl_map.h:1218:7: note:   candidate expects 1 argument, 3 provided
/usr/include/c++/14/bits/stl_map.h:1243:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::const_iterator std::map<_Key, _Tp, _Compare, _Alloc>::find(const key_type&) const [with _Key = std::__cxx11::basic_string<char>; _Tp = long long int; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, long long int> >; const_iterator = std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, long long int>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, long long int> >, std::less<std::__cxx11::basic_string<char> >, std::allocator<std::pair<const std::__cxx11::basic_string<char>, long long int> > >::const_iterator; key_type = std::__cxx11::basic_string<char>]'
 1243 |       find(const key_type& __x) const
      |       ^~~~
/usr/include/c++/14/bits/stl_map.h:1243:7: note:   candidate expects 1 argument, 3 provided
In file included from /usr/include/c++/14/numeric:62,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:58:
/usr/include/c++/14/bits/stl_numeric.h: In instantiation of '_Tp std::accumulate(_InputIterator, _InputIterator, _Tp) [with _InputIterator = _Rb_tree_iterator<pair<const __cxx11::basic_string<char>, long long int> >; _Tp = long long int]':
a.cc:36:24:   required from here
   36 |     ll ans = accumulate(ALL(m),0LL);
      |              ~~~~~~~~~~^~~~~~~~~~~~
/usr/include/c++/14/bits/stl_numeric.h:141:46: error: no match for 'operator+' (operand types are 'long long int' and 'std::pair<const std::__cxx11::basic_string<char>, long long int>')
  141 |         __init = _GLIBCXX_MOVE_IF_20(__init) + *__first;
      |                                              ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:67,
                 from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/stl_iterator.h:627:5: note: candidate: 'template<class _Iterator> constexpr std::reverse_iterator<_Iterator> std::operator+(typename reverse_iterator<_Iterator>::difference_type, const reverse_iterator<_Iterator>&)'
  627 |     operator+(typename reverse_iterator<_Iterator>::difference_type __n,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:627:5: note:   template argument deduction/substitution failed:
/usr/include/c++/14/bits/stl_numeric.h:141:46: note:   'std::pair<const std::__cxx11::basic_string<char>, long long int>' is not derived from 'const std::reverse_iterator<_Iterator>'
  141 |         __init = _GLIBCXX_MOVE_IF_20(__init) + *__first;
      |                                              ^
/usr/include/c++/14/bits/stl_iterator.h:1798:5: note: candidate: 'template<class _Iterator> constexpr std::move_iterator<_IteratorL> std::operator+(typename move_iterator<_IteratorL>::difference_type, const move_iterator<_IteratorL>&)'
 1798 |     operator+(typename move_iterator<_Iterator>::difference_type __n,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1798:5: note:   template argument deduction/substitution failed:
/usr/include/c++/14/bits/stl_numeric.h:141:46: note:   'std::pair<const std::__cxx11::basic_string<char>, long long int>' is not derived from 'const std::move_iterator<_IteratorL>'
  141 |         __init = _GLIBCXX_MOVE_IF_20(__init) + *__first;
      |                                              ^
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:
/usr/include/c++/14/bits/basic_string.h:3598:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
 3598 |     operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3598:5: note:   template argument deduction/substitution failed:
/usr/include/c++/14/bits/stl_numeric.h:141:46: note:   mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'long long int'
  141 |         __init = _GLIBCXX_MOVE_IF_20(__init) + *__first;
      |                                              ^
/usr/include/c++/14/bits/basic_string.h:3616:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
 3616 |     operator+(const _CharT* __lhs,
      |     ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3616:5: note:   template argument deduction/substitution failed:
/usr/include/c++/14/bits/stl_numeric.h:141:46: note:   mismatched types 'const _CharT*' and 'long long int'
  141 |         __init = _GLIBCXX_MOVE_IF_20(__init) + *__first;
      |                                              ^
/usr/include/c++/14/bits/basic_string.h:3635:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
 3635 |     operator+(_CharT __lhs, const basic_string<_CharT,_Traits,_Alloc>& __rhs)
      |     ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3635:5: note:   template argument deduction/substitution failed:
/usr/include/c++/14/bits/stl_numeric.h:141:46: note:   'std::pair<const std::__cxx11::basic_string<char>, long long int>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
  141 |         __init = _GLIBCXX_MOVE_IF_20(__init) + *__first;
      |                                              ^
/usr/include/c++/14/bits/basic_string.h:3652:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)'
 3652 |     operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3652:5: note:   template argument deduction/substitution failed:
/usr/include/c++/14/bits/stl_numeric.h:141:46: note:   mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'long long int'
  141 |         __init = _GLIBCXX_MOVE_IF_20(__init) + *__first;
      |                                              ^
/usr/include/c++/14/bits/basic_string.h:3670:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, _CharT)'
 3670 |     operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, _CharT __rhs)
      |     ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3670:5: note:   template argument deduction/substitution failed:
/usr/include/c++/14/bits/stl_numeric.h:141:46: note:   mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'long long int'
  141 |         __init = _GLIBCXX_MOVE_IF_20(__init) + *__first;
      |