Language: C++

#include<bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long ll;
ll gcd(ll a,ll b){return b!=0?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a*b/gcd(a,b);}

int main(){
    ll n,s=0;
    cin>>n;
    map<string,ll> mp;
    string s;
    for(ll i=0;i<n;i++){
        cin>>s;
        sort(all(s));
        mp[s]++;
    }
    for(auto i:mp){
        ll j=i->second;
        s+=j*(j-1)/2;
    }
    cout<<s<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:12: error: conflicting declaration 'std::string s'
   12 |     string s;
      |            ^
a.cc:9:10: note: previous declaration as 'll s'
    9 |     ll n,s=0;
      |          ^
a.cc:2:20: error: request for member 'begin' in 's', which is of non-class type 'll' {aka 'long long int'}
    2 | #define all(x) (x).begin(),(x).end()
      |                    ^~~~~
a.cc:15:14: note: in expansion of macro 'all'
   15 |         sort(all(s));
      |              ^~~
a.cc:2:32: error: request for member 'end' in 's', which is of non-class type 'll' {aka 'long long int'}
    2 | #define all(x) (x).begin(),(x).end()
      |                                ^~~
a.cc:15:14: note: in expansion of macro 'all'
   15 |         sort(all(s));
      |              ^~~
a.cc:16:11: error: no match for 'operator[]' (operand types are 'std::map<std::__cxx11::basic_string<char>, long long int>' and 'll' {aka 'long long int'})
   16 |         mp[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 = 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> >; mapped_type = long long int; key_type = std::__cxx11::basic_string<char>]'
  504 |       operator[](const key_type& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:504:34: note:   no known conversion for argument 1 from 'll' {aka 'long long int'} to 'const std::map<std::__cxx11::basic_string<char>, long long int>::key_type&' {aka 'const std::__cxx11::basic_string<char>&'}
  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 = 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> >; mapped_type = long long int; key_type = std::__cxx11::basic_string<char>]'
  524 |       operator[](key_type&& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:524:29: note:   no known conversion for argument 1 from 'll' {aka 'long long int'} to 'std::map<std::__cxx11::basic_string<char>, long long int>::key_type&&' {aka 'std::__cxx11::basic_string<char>&&'}
  524 |       operator[](key_type&& __k)
      |                  ~~~~~~~~~~~^~~
a.cc:19:15: error: base operand of '->' has non-pointer type 'std::pair<const std::__cxx11::basic_string<char>, long long int>'
   19 |         ll j=i->second;
      |               ^~