Language: C++

/*
    author : SAMRAT DE
    username : Alucard_01
    NIT Durgapur
*/

/*#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>*/
#include<bits/stdc++.h>
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL)
#define ll long long int
#define vec(x) vector<x> 
#define st(x) set<x> 
#define pi(x,y) pair<x,y>
#define mpp(x,y) map<x,y>
#define pqq(x) priority_queue<x> 
#define min_heap(x) priority_queue<x, vector<x>, greater<x> >
#define all(x) x.begin(),x.end()
#define rep(i,x,y) for(ll i=x;i<y;i++)
#define rel(i,x,y) for(ll i=x-1;i>=y;i--)
#define rev(x) reverse(x.begin(),x.end())
#define mem(x,a) memset(x,a,sizeof(x))
#define mod 1000000007
#define nxt_per(x) next_permutation(x.begin(),x.end())
#define pb push_back
#define pf push_front
#define indexof order_of_key
#define valueat find_by_order
#define myds tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> 

ll nCr(int n,int r){
    vec(ll) C(r+1);
    C[0]=1;
    rep(i,1,n+1) for(int j=min(i,r);j<1;--j)C[j]=(C[j]+C[j-1])%mod;
    return C[r];
}

int dx[4]={0,0,1,-1};
int dy[4]={1,-1,0,0};
int dxx[8]={0,0,1,-1,-1,-1,1,1};
int dyy[8]={1,-1,0,0,-1,1,1,-1};

using namespace std;
//using namespace __gnu_pbds;

int32_t main()
{
    fastio;
    //best of luck don't loose hope man 
        
    int n;
    cin>>n;
    mpp(string,int) m;
    ll ans=0;
    rep(i,0,n){
        string s;
        cin>>s;
        sort(all(s));
        if(m.count(s)==0)
            m[s]=0;
        else
            ans+=++m[s];
    }
    cout<<ans<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'long long int nCr(int, int)':
a.cc:12:16: error: 'vector' was not declared in this scope
   12 | #define vec(x) vector<x>
      |                ^~~~~~
a.cc:32:5: note: in expansion of macro 'vec'
   32 |     vec(ll) C(r+1);
      |     ^~~
a.cc:12:16: note: suggested alternatives:
   12 | #define vec(x) vector<x>
      |                ^~~~~~
a.cc:32:5: note: in expansion of macro 'vec'
   32 |     vec(ll) C(r+1);
      |     ^~~
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:9:
/usr/include/c++/14/bits/stl_vector.h:428:11: note:   'std::vector'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/14/vector:93:13: note:   'std::pmr::vector'
   93 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
a.cc:11:12: error: expected primary-expression before 'long'
   11 | #define ll long long int
      |            ^~~~
a.cc:12:23: note: in definition of macro 'vec'
   12 | #define vec(x) vector<x>
      |                       ^
a.cc:32:9: note: in expansion of macro 'll'
   32 |     vec(ll) C(r+1);
      |         ^~
a.cc:33:5: error: 'C' was not declared in this scope
   33 |     C[0]=1;
      |     ^
a.cc:34:28: error: 'min' was not declared in this scope; did you mean 'std::min'?
   34 |     rep(i,1,n+1) for(int j=min(i,r);j<1;--j)C[j]=(C[j]+C[j-1])%mod;
      |                            ^~~
      |                            std::min
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: 'std::min' declared here
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~