Language: C++

#include <bits/stdc++.h>
#define rep(i , n) for(int (i) = 0; (i) < (n); (i)++)


bool compare(std::pair<std::string , std::pair<int , int>> a , std::pair<std::string , std::pair<int , int>> b){
    return a.second.second > b.second.second;
}

int main(){

    int N; std::cin >> N;

    std::vector<std::pair<std::string , std::pair<int , int>>> vec(N);

    rep(i , N){
        std::cin >> vec[i].first >> vec[i].second.second;
        vec[i].second.first = i + 1;
    }

    std::sort(vec.begin() , vec.end());

    std::string now_city = vec[0].first;

    std::vector<int> sub;

    rep(i , N){
        if(now_city != vec[i].first){
            std::sort(sub.begin() , sub.end());
            std::reverse(sub.begin , sub.end());
            rep(j , sub.size())std::cout << sub[i] << std::endl;
            sub.clear();
        }else{
            sub.push_back(vec[i]);
        }
    }

    system("pause");

    return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:25: error: no matching function for call to 'reverse(<unresolved overloaded function type>, std::vector<int>::iterator)'
   29 |             std::reverse(sub.begin , sub.end());
      |             ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:1083:5: note: candidate: 'void std::reverse(_BIter, _BIter) [with _BIter = __gnu_cxx::__normal_iterator<int*, vector<int> >]'
 1083 |     reverse(_BidirectionalIterator __first, _BidirectionalIterator __last)
      |     ^~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1083:36: note:   no known conversion for argument 1 from '<unresolved overloaded function type>' to '__gnu_cxx::__normal_iterator<int*, std::vector<int> >'
 1083 |     reverse(_BidirectionalIterator __first, _BidirectionalIterator __last)
      |             ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:249:1: note: candidate: 'template<class _ExecutionPolicy, class _BidirectionalIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::reverse(_ExecutionPolicy&&, _BidirectionalIterator, _BidirectionalIterator)'
  249 | reverse(_ExecutionPolicy&& __exec, _BidirectionalIterator __first, _BidirectionalIterator __last);
      | ^~~~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:249:1: note:   candidate expects 3 arguments, 2 provided
a.cc:33:26: error: no matching function for call to 'std::vector<int>::push_back(__gnu_cxx::__alloc_traits<std::allocator<std::pair<std::__cxx11::basic_string<char>, std::pair<int, int> > >, std::pair<std::__cxx11::basic_string<char>, std::pair<int, int> > >::value_type&)'
   33 |             sub.push_back(vec[i]);
      |             ~~~~~~~~~~~~~^~~~~~~~
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:
/usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = int; _Alloc = std::allocator<int>; value_type = int]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:35: note:   no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::pair<std::__cxx11::basic_string<char>, std::pair<int, int> > >, std::pair<std::__cxx11::basic_string<char>, std::pair<int, int> > >::value_type' {aka 'std::pair<std::__cxx11::basic_string<char>, std::pair<int, int> >'} to 'const std::vector<int>::value_type&' {aka 'const int&'}
 1283 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = int; _Alloc = std::allocator<int>; value_type = int]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:30: note:   no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::pair<std::__cxx11::basic_string<char>, std::pair<int, int> > >, std::pair<std::__cxx11::basic_string<char>, std::pair<int, int> > >::value_type' {aka 'std::pair<std::__cxx11::basic_string<char>, std::pair<int, int> >'} to 'std::vector<int>::value_type&&' {aka 'int&&'}
 1300 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~