Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
  int N,points;
  string cities;
  cin >> N;
  pair<pair<string,int>,int> rest[N];

  for(int i=0;i<N;++i){
    cin >> cities;
    cin >> points;
    rest[i] = make_pair<make_pair<cities,100-points>,i>;
  }

  sort(rest.begin(),rest.end());
  
  for (int i=0;i<N;++i){
    cout >> rest.second(i) >> endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:46: error: the value of 'points' is not usable in a constant expression
   13 |     rest[i] = make_pair<make_pair<cities,100-points>,i>;
      |                                              ^~~~~~
a.cc:5:9: note: 'int points' is not const
    5 |   int N,points;
      |         ^~~~~~
a.cc:13:15: error: no match for 'operator=' (operand types are 'std::pair<std::pair<std::__cxx11::basic_string<char>, int>, int>' and '<unresolved overloaded function type>')
   13 |     rest[i] = make_pair<make_pair<cities,100-points>,i>;
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_pair.h:946:9: note: candidate: 'template<class _U1, class _U2> typename std::enable_if<std::__and_<std::is_assignable<_T1&, const _U1&>, std::is_assignable<_T2&, const _U2&> >::value, std::pair<_T1, _T2>&>::type std::pair<_T1, _T2>::operator=(const std::pair<_U1, _U2>&) [with _U2 = _U1; _T1 = std::pair<std::__cxx11::basic_string<char>, int>; _T2 = int]'
  946 |         operator=(const pair<_U1, _U2>& __p)
      |         ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:946:9: note:   template argument deduction/substitution failed:
a.cc:13:15: note:   couldn't deduce template parameter '_U1'
   13 |     rest[i] = make_pair<make_pair<cities,100-points>,i>;
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:957:9: note: candidate: 'template<class _U1, class _U2> typename std::enable_if<std::__and_<std::is_assignable<_T1&, _U1&&>, std::is_assignable<_T2&, _U2&&> >::value, std::pair<_T1, _T2>&>::type std::pair<_T1, _T2>::operator=(std::pair<_U1, _U2>&&) [with _U2 = _U1; _T1 = std::pair<std::__cxx11::basic_string<char>, int>; _T2 = int]'
  957 |         operator=(pair<_U1, _U2>&& __p)
      |         ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:957:9: note:   template argument deduction/substitution failed:
a.cc:13:15: note:   couldn't deduce template parameter '_U1'
   13 |     rest[i] = make_pair<make_pair<cities,100-points>,i>;
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:921:7: note: candidate: 'std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(std::__conditional_t<((bool)std::__and_<std::is_copy_assignable<_T1>, std::is_copy_assignable<_T2> >::value), const std::pair<_T1, _T2>&, const std::__nonesuch&>) [with _T1 = std::pair<std::__cxx11::basic_string<char>, int>; _T2 = int; std::__conditional_t<((bool)std::__and_<std::is_copy_assignable<_T1>, std::is_copy_assignable<_T2> >::value), const std::pair<_T1, _T2>&, const std::__nonesuch&> = const std::pair<std::pair<std::__cxx11::basic_string<char>, int>, int>&]'
  921 |       operator=(__conditional_t<__and_<is_copy_assignable<_T1>,
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:923:65: note:   no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::__conditional_t<true, const std::pair<std::pair<std::__cxx11::basic_string<char>, int>, int>&, const std::__nonesuch&>' {aka 'const std::pair<std::pair<std::__cxx11::basic_string<char>, int>, int>&'}
  921 |       operator=(__conditional_t<__and_<is_copy_assignable<_T1>,
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  
  922 |                                        is_copy_assignable<_T2>>::value,
      |                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  923 |                                 const pair&, const __nonesuch&> __p)
      |                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_pair.h:931:7: note: candidate: 'std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(std::__conditional_t<((bool)std::__and_<std::is_move_assignable<_Tp>, std::is_move_assignable<_T2> >::value), std::pair<_T1, _T2>&&, std::__nonesuch&&>) [with _T1 = std::pair<std::__cxx11::basic_string<char>, int>; _T2 = int; std::__conditional_t<((bool)std::__and_<std::is_move_assignable<_Tp>, std::is_move_assignable<_T2> >::value), std::pair<_T1, _T2>&&, std::__nonesuch&&> = std::pair<std::pair<std::__cxx11::basic_string<char>, int>, int>&&]'
  931 |       operator=(__conditional_t<__and_<is_move_assignable<_T1>,
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:933:55: note:   no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::__conditional_t<true, std::pair<std::pair<std::__cxx11::basic_string<char>, int>, int>&&, std::__nonesuch&&>' {aka 'std::pair<std::pair<std::__cxx11::basic_string<char>, int>, int>&&'}
  931 |       operator=(__conditional_t<__and_<is_move_assignable<_T1>,
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  932 |                                        is_move_assignable<_T2>>::value,
      |                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  933 |                                 pair&&, __nonesuch&&> __p)
      |                                 ~~~~~~~~~~~~~~~~~~~~~~^~~
a.cc:16:13: error: request for member 'begin' in 'rest', which is of non-class type 'std::pair<std::pair<std::__cxx11::basic_string<char>, int>, int> [N]'
   16 |   sort(rest.begin(),rest.end());
      |             ^~~~~
a.cc:16:26: error: request for member 'end' in 'rest', which is of non-class type 'std::pair<std::pair<std::__cxx11::basic_string<char>, int>, int> [N]'
   16 |   sort(rest.begin(),rest.end());
      |                          ^~~
a.cc:19:18: error: request for member 'second' in 'rest', which is of non-class type 'std::pair<std::pair<std::__cxx11::basic_string<char>, int>, int> [N]'
   19 |     cout >> rest.second(i) >> endl;
      |                  ^~~~~~