Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef struct data
{
    int pos;
    char a0;
    char a[12];
}data;
data s[100000+5];
int cmp(data aa,data bb)
{
    int flag=strcmp(aa.a,bb.a);
    if(flag>=0)
        return 1;
    else
        return 0;
}
int main()
{
    char x[12];
    int n,i;
    scanf("%d",&n);
    getchar();
    for(i=0;i<n;i++)
    {
        gets(x);
        sort(x,x+10);
        strcpy(s[i].a,x);
        //printf("%s\n",s[i].a);
        s[i].a0=x[0];
    }
    sort(s,s+n,cmp);
    long long int ans=0;

    /*for(i=0;i<n;i++)
    {
        printf("%s\n",s[i].a);
    }*/
    for(i=0;i<n;i++)
    {
        //printf("%s\n",s[i].a);
        int  cnt=1;
        while(i+1<n&&strcmp(s[i].a,s[i+1].a)==0)
        {
            cnt++;
            i++;
        }
        ans+=(cnt-1)*cnt/2;
    }
    printf("%lld\n",ans);
    return 0;
}


Compiler output:
a.cc:9:1: error: reference to 'data' is ambiguous
    9 | data s[100000+5];
      | ^~~~
In file included from /usr/include/c++/14/string:53,
                 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/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  334 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  323 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  312 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
a.cc:8:2: note:                 'typedef struct data data'
    8 | }data;
      |  ^~~~
a.cc:10:9: error: reference to 'data' is ambiguous
   10 | int cmp(data aa,data bb)
      |         ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  334 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  323 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  312 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
a.cc:8:2: note:                 'typedef struct data data'
    8 | }data;
      |  ^~~~
a.cc:10:17: error: reference to 'data' is ambiguous
   10 | int cmp(data aa,data bb)
      |                 ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  334 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  323 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  312 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
a.cc:8:2: note:                 'typedef struct data data'
    8 | }data;
      |  ^~~~
a.cc:10:24: error: expression list treated as compound expression in initializer [-fpermissive]
   10 | int cmp(data aa,data bb)
      |                        ^
a.cc: In function 'int main()':
a.cc:26:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
   26 |         gets(x);
      |         ^~~~
      |         getw
a.cc:28:16: error: 's' was not declared in this scope
   28 |         strcpy(s[i].a,x);
      |                ^
a.cc:32:10: error: 's' was not declared in this scope
   32 |     sort(s,s+n,cmp);
      |          ^