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 operator <(const data &D){
        if(str==D.str) return(val>D.val);
        return(str<D.str);
    }

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






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


Compiler output:
a.cc: In function 'void solve()':
a.cc:42:16: error: template argument 1 is invalid
   42 |     vector<data> v(n);
      |                ^
a.cc:42:16: error: template argument 2 is invalid
a.cc:47:10: error: invalid types 'int[int]' for array subscript
   47 |         v[i].in=i;
      |          ^
a.cc:48:10: error: invalid types 'int[int]' for array subscript
   48 |         v[i].str=s;
      |          ^
a.cc:49:10: error: invalid types 'int[int]' for array subscript
   49 |         v[i].val=a;
      |          ^
a.cc:51:12: error: request for member 'begin' in 'v', which is of non-class type 'int'
   51 |     sort(v.begin(),v.end());
      |            ^~~~~
a.cc:51:22: error: request for member 'end' in 'v', which is of non-class type 'int'
   51 |     sort(v.begin(),v.end());
      |                      ^~~
a.cc:52:17: error: 'begin' was not declared in this scope
   52 |     for(auto vv:v) cout<<vv.in+1<<endl;
      |                 ^
a.cc:52:17: note: suggested alternatives:
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166,
                 from a.cc:1:
/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:52:17: error: 'end' was not declared in this scope
   52 |     for(auto vv:v) cout<<vv.in+1<<endl;
      |                 ^
a.cc:52: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
      |   ^~~