Language: C++

/* Note:
Check constants at the beginning of the code.
    N is set to 4e5 but be careful in problems with large constant factor.
    Setting N in every problem is more effective.
Check corner cases.
    N = 1
No def int long long for now.
Add something here.

*/
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
typedef long double ld;

int mod = 1000000007;
ll dp[100005];
const ll INF = 1e18;

ll gcd(long long a,long long b){
  if(b == 0)
    return a;
  else return gcd(b,a%b);
}

bool sortbyval(const pair<string, int> &a,
               const pair<string, int> &b){
    return (a.second < b.second);
}


int main(){

 ll n;
 cin>>n;
 string s;

 vector<pair<string,int>,int> >reset(n);

  for(int i=0;i<n;i++){
    cin>>s>>p;

    reset.at(i).first.first(s);
    reset.at(i).first.second(-p);  //intentionally using the minus sign so that the
    // functions will sort the elements in the greatner ness order

    reset.at(i).second(i+1);
 }

  for(vector<pair<string,int>,int>::iterator it=reset.begin();it!=reset.end();it++){
        cout<<it->second<<endl;
  }

return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:39:31: error: expected unqualified-id before '>' token
   39 |  vector<pair<string,int>,int> >reset(n);
      |                               ^
a.cc:42:13: error: 'p' was not declared in this scope
   42 |     cin>>s>>p;
      |             ^
a.cc:44:5: error: 'reset' was not declared in this scope
   44 |     reset.at(i).first.first(s);
      |     ^~~~~
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:11:
/usr/include/c++/14/bits/stl_vector.h: In instantiation of 'struct std::_Vector_base<std::pair<std::__cxx11::basic_string<char>, int>, int>':
/usr/include/c++/14/bits/stl_vector.h:428:11:   required from 'class std::vector<std::pair<std::__cxx11::basic_string<char>, int>, int>'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
a.cc:51:35:   required from here
   51 |   for(vector<pair<string,int>,int>::iterator it=reset.begin();it!=reset.end();it++){
      |                                   ^~
/usr/include/c++/14/bits/stl_vector.h:87:28: error: 'int' is not a class, struct, or union type
   87 |         rebind<_Tp>::other _Tp_alloc_type;
      |                            ^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:89:9: error: 'int' is not a class, struct, or union type
   89 |         pointer;
      |         ^~~~~~~
/usr/include/c++/14/bits/stl_vector.h: In instantiation of 'class std::vector<std::pair<std::__cxx11::basic_string<char>, int>, int>':
a.cc:51:35:   required from here
   51 |   for(vector<pair<string,int>,int>::iterator it=reset.begin();it!=reset.end();it++){
      |                                   ^~
/usr/include/c++/14/bits/stl_vector.h:518:20: error: '_M_allocate' has not been declared in 'std::vector<std::pair<std::__cxx11::basic_string<char>, int>, int>::_Base'
  518 |       using _Base::_M_allocate;
      |                    ^~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:519:20: error: '_M_deallocate' has not been declared in 'std::vector<std::pair<std::__cxx11::basic_string<char>, int>, int>::_Base'
  519 |       using _Base::_M_deallocate;
      |                    ^~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:521:20: error: '_M_get_Tp_allocator' has not been declared in 'std::vector<std::pair<std::__cxx11::basic_string<char>, int>, int>::_Base'
  521 |       using _Base::_M_get_Tp_allocator;
      |                    ^~~~~~~~~~~~~~~~~~~
a.cc:51:49: error: 'reset' was not declared in this scope
   51 |   for(vector<pair<string,int>,int>::iterator it=reset.begin();it!=reset.end();it++){
      |                                                 ^~~~~
a.cc:51:63: error: 'it' was not declared in this scope; did you mean 'int'?
   51 |   for(vector<pair<string,int>,int>::iterator it=reset.begin();it!=reset.end();it++){
      |                                                               ^~
      |                                                               int