Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
int32_t main()
{
 ll n,count=0;
  string s;
  map<ll,string>m;
  cin>>n;
  for(int i=0;i<n;i++)
  {
    cin>>s;
    sort(s.begin(),s.end());
    count+=m[s];
    m[s]++;
    cout<<count<<"\n";
  }
  return 0;
}
    


Compiler output:
a.cc: In function 'int32_t main()':
a.cc:14:13: error: no match for 'operator[]' (operand types are 'std::map<long long int, std::__cxx11::basic_string<char> >' and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
   14 |     count+=m[s];
      |             ^
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:504:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = long long int; _Tp = std::__cxx11::basic_string<char>; _Compare = std::less<long long int>; _Alloc = std::allocator<std::pair<const long long int, std::__cxx11::basic_string<char> > >; mapped_type = std::__cxx11::basic_string<char>; key_type = long long int]'
  504 |       operator[](const key_type& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:504:34: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const std::map<long long int, std::__cxx11::basic_string<char> >::key_type&' {aka 'const long long int&'}
  504 |       operator[](const key_type& __k)
      |                  ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_map.h:524:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](key_type&&) [with _Key = long long int; _Tp = std::__cxx11::basic_string<char>; _Compare = std::less<long long int>; _Alloc = std::allocator<std::pair<const long long int, std::__cxx11::basic_string<char> > >; mapped_type = std::__cxx11::basic_string<char>; key_type = long long int]'
  524 |       operator[](key_type&& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:524:29: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'std::map<long long int, std::__cxx11::basic_string<char> >::key_type&&' {aka 'long long int&&'}
  524 |       operator[](key_type&& __k)
      |                  ~~~~~~~~~~~^~~
a.cc:15:6: error: no match for 'operator[]' (operand types are 'std::map<long long int, std::__cxx11::basic_string<char> >' and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
   15 |     m[s]++;
      |      ^
/usr/include/c++/14/bits/stl_map.h:504:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = long long int; _Tp = std::__cxx11::basic_string<char>; _Compare = std::less<long long int>; _Alloc = std::allocator<std::pair<const long long int, std::__cxx11::basic_string<char> > >; mapped_type = std::__cxx11::basic_string<char>; key_type = long long int]'
  504 |       operator[](const key_type& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:504:34: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const std::map<long long int, std::__cxx11::basic_string<char> >::key_type&' {aka 'const long long int&'}
  504 |       operator[](const key_type& __k)
      |                  ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_map.h:524:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](key_type&&) [with _Key = long long int; _Tp = std::__cxx11::basic_string<char>; _Compare = std::less<long long int>; _Alloc = std::allocator<std::pair<const long long int, std::__cxx11::basic_string<char> > >; mapped_type = std::__cxx11::basic_string<char>; key_type = long long int]'
  524 |       operator[](key_type&& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:524:29: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'std::map<long long int, std::__cxx11::basic_string<char> >::key_type&&' {aka 'long long int&&'}
  524 |       operator[](key_type&& __k)
      |                  ~~~~~~~~~~~^~~