Language: C++

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC optimize("unroll-loops,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
using namespace __gnu_pbds;
using namespace std;
/*
int dx[]={-1,1,0,0};
int dy[]={0,0,-1,1};
*/
#define ull unsigned long long int
#define ll long long int
#define MAX 1000000007
//1e9+7
#define pll pair<ll,ll>
#define pii pair<int,int>
#define IO ios_base::sync_with_stdio(false); cin.tie(NULL);
#define FO ifstream fin("a.in");ofstream fout("a.out");
#define TEST int testcase;cin>>testcase;while(testcase--)
#define FTEST int testcase;fin>>testcase;while(testcase--)
#define all(x) (x).begin(),(x).end()
#define mset0(x) memset((x), 0, sizeof((x)));
#define mset1(x) memset((x), -1, sizeof((x)));
#define endl "\n"
#define plll pair<ll,pll>
typedef tree<ll,null_type,less<ll>,rb_tree_tag, tree_order_statistics_node_update> indexed_set;
FO
struct data{
    int in;string str;int val;


};

bool cmp(data d1,data d2){
    if(d1.str==d2.str){
        return(d1.val>d2.val);
    }
    else return(d1.str<d2.str);

}
void solve(){
    int n;
    cin>>n;
    vector<data> v;
    data d;
    for(int i=0;i<n;i++){
        string s;
        int a;
        cin>>s>>a;
        d.in=i;
        d.str=s;
        d.val=a;
        v.push_back(d);
    }
    sort(v.begin(),v.end(),cmp);
    for(auto vv:v) cout<<vv.in+1<<endl;






    return;
}
int main(){
    IO
    //TEST
    solve();
    return(0);
}


Compiler output:
a.cc:37:10: error: reference to 'data' is ambiguous
   37 | bool cmp(data d1,data d2){
      |          ^~~~
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:31:8: note:                 'struct data'
   31 | struct data{
      |        ^~~~
a.cc:37:18: error: reference to 'data' is ambiguous
   37 | bool cmp(data d1,data d2){
      |                  ^~~~
/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:31:8: note:                 'struct data'
   31 | struct data{
      |        ^~~~
a.cc:37:25: error: expression list treated as compound expression in initializer [-fpermissive]
   37 | bool cmp(data d1,data d2){
      |                         ^
a.cc: In function 'void solve()':
a.cc:47:16: error: template argument 1 is invalid
   47 |     vector<data> v;
      |                ^
a.cc:47:16: error: template argument 2 is invalid
a.cc:48:5: error: reference to 'data' is ambiguous
   48 |     data d;
      |     ^~~~
/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:31:8: note:                 'struct data'
   31 | struct data{
      |        ^~~~
a.cc:53:9: error: 'd' was not declared in this scope
   53 |         d.in=i;
      |         ^
a.cc:56:11: error: request for member 'push_back' in 'v', which is of non-class type 'int'
   56 |         v.push_back(d);
      |           ^~~~~~~~~
a.cc:58:12: error: request for member 'begin' in 'v', which is of non-class type 'int'
   58 |     sort(v.begin(),v.end(),cmp);
      |            ^~~~~
a.cc:58:22: error: request for member 'end' in 'v', which is of non-class type 'int'
   58 |     sort(v.begin(),v.end(),cmp);
      |                      ^~~
a.cc:59:17: error: 'begin' was not declared in this scope
   59 |     for(auto vv:v) cout<<vv.in+1<<endl;
      |                 ^
a.cc:59:17: note: suggested alternatives:
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166:
/usr/include/c++/14/valarray:1238:5: note:   'std::begin'
 1238 |     begin(const valarray<_Tp>& __va) noexcept
      |     ^~~~~
In file included from /usr/include/c++/14/filesystem:53,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:200:
/usr/include/c++/14/bits/fs_dir.h:608:3: note:   'std::filesystem::__cxx11::begin'
  608 |   begin(recursive_directory_iterator __iter) noexcept
      |   ^~~~~
a.cc:59:17: error: 'end' was not declared in this scope
   59 |     for(auto vv:v) cout<<vv.in+1<<endl;
      |                 ^
a.cc:59:17: note: suggested alternatives:
/usr/include/c++/14/valarray:1265:5: note:   'std::end'
 1265 |     end(const valarray<_Tp>& __va) noexcept
      |     ^~~
/usr/include/c++/14/bits/fs_dir.h:613:3: note:   'std::filesystem::__cxx11::end'
  613 |   end(recursive_directory_iterator) noexcept
      |   ^~~