Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
typedef long long ll;
#define _GLIBCXX_DEBUG
typedef vector<int> vec;
typedef vector<ll> lvec;
typedef vector<char>cvec;
typedef pair<ll, ll> LP;
typedef tuple<ll, ll, ll> LT;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;
#define second sc;
#define first fst;
int main()	{
  int n;
  cin>>n;
  vector<int>p(n);
  vector<string>s(n);
  rep(i,n) {
    cin>>s[i]>>p[i];
    p[i]--;
  vector<pair<string,int>>mp;
  rep(i,n){
    mp.push_back(make_pair(s[i],p[i]);
  }
  sort(all(mp));
  rep(i,n-1){
    if(mp[i].fst==mp[i+1].fst && mp[i].sc<mp[i+1].sc){
      int tmp=mp[i].sc;
      mp[i].sc=mp[i+1].sc;
      mp[i+1].sc=tmp;
    }
  rep(i,n){
    cout<<mp[i].sc+1<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:38: error: expected ')' before ';' token
   27 |     mp.push_back(make_pair(s[i],p[i]);
      |                 ~                    ^
      |                                      )
a.cc:31:14: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<std::__cxx11::basic_string<char>, int> >, std::pair<std::__cxx11::basic_string<char>, int> >::value_type' {aka 'struct std::pair<std::__cxx11::basic_string<char>, int>'} has no member named 'fst'; did you mean 'first'?
   31 |     if(mp[i].fst==mp[i+1].fst && mp[i].sc<mp[i+1].sc){
      |              ^~~
      |              first
a.cc:31:27: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<std::__cxx11::basic_string<char>, int> >, std::pair<std::__cxx11::basic_string<char>, int> >::value_type' {aka 'struct std::pair<std::__cxx11::basic_string<char>, int>'} has no member named 'fst'; did you mean 'first'?
   31 |     if(mp[i].fst==mp[i+1].fst && mp[i].sc<mp[i+1].sc){
      |                           ^~~
      |                           first
a.cc:31:40: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<std::__cxx11::basic_string<char>, int> >, std::pair<std::__cxx11::basic_string<char>, int> >::value_type' {aka 'struct std::pair<std::__cxx11::basic_string<char>, int>'} has no member named 'sc'
   31 |     if(mp[i].fst==mp[i+1].fst && mp[i].sc<mp[i+1].sc){
      |                                        ^~
a.cc:31:51: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<std::__cxx11::basic_string<char>, int> >, std::pair<std::__cxx11::basic_string<char>, int> >::value_type' {aka 'struct std::pair<std::__cxx11::basic_string<char>, int>'} has no member named 'sc'
   31 |     if(mp[i].fst==mp[i+1].fst && mp[i].sc<mp[i+1].sc){
      |                                                   ^~
a.cc:32:21: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<std::__cxx11::basic_string<char>, int> >, std::pair<std::__cxx11::basic_string<char>, int> >::value_type' {aka 'struct std::pair<std::__cxx11::basic_string<char>, int>'} has no member named 'sc'
   32 |       int tmp=mp[i].sc;
      |                     ^~
a.cc:33:13: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<std::__cxx11::basic_string<char>, int> >, std::pair<std::__cxx11::basic_string<char>, int> >::value_type' {aka 'struct std::pair<std::__cxx11::basic_string<char>, int>'} has no member named 'sc'
   33 |       mp[i].sc=mp[i+1].sc;
      |             ^~
a.cc:33:24: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<std::__cxx11::basic_string<char>, int> >, std::pair<std::__cxx11::basic_string<char>, int> >::value_type' {aka 'struct std::pair<std::__cxx11::basic_string<char>, int>'} has no member named 'sc'
   33 |       mp[i].sc=mp[i+1].sc;
      |                        ^~
a.cc:34:15: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<std::__cxx11::basic_string<char>, int> >, std::pair<std::__cxx11::basic_string<char>, int> >::value_type' {aka 'struct std::pair<std::__cxx11::basic_string<char>, int>'} has no member named 'sc'
   34 |       mp[i+1].sc=tmp;
      |               ^~
a.cc:37:17: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<std::__cxx11::basic_string<char>, int> >, std::pair<std::__cxx11::basic_string<char>, int> >::value_type' {aka 'struct std::pair<std::__cxx11::basic_string<char>, int>'} has no member named 'sc'
   37 |     cout<<mp[i].sc+1<<endl;
      |                 ^~
a.cc:39:2: error: expected '}' at end of input
   39 | }
      |  ^
a.cc:22:12: note: to match this '{'
   22 |   rep(i,n) {
      |            ^
a.cc:39:2: error: expected '}' at end of input
   39 | }
      |  ^
a.cc:17:17: note: to match this '{'
   17 | int main()      {
      |                 ^