Language: C++

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

int main(){
  int N;
  cin >> N;
  vector<pair<int, string>> data(N);
  for(int i=0; i<N; i++){
    int a,b;
    cin >> a >>b;
    data.at(i) = make_pair(b,a);
  }
  sort(data.begin(),data.end());
  for(int i=0; i<N; i++){
    int a,b;
    tie(b,a)=data.at(i);
    cout << a << " " << b <<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:23: error: no match for 'operator=' (operand types are 'std::tuple<int&, int&>' and '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, std::__cxx11::basic_string<char> > >, std::pair<int, std::__cxx11::basic_string<char> > >::value_type' {aka 'std::pair<int, std::__cxx11::basic_string<char> >'})
   16 |     tie(b,a)=data.at(i);
      |                       ^
In file included from /usr/include/c++/14/bits/memory_resource.h:47,
                 from /usr/include/c++/14/string:68,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/tuple:2355:9: note: candidate: 'template<class _U1, class _U2> std::__enable_if_t<((bool)__assignable<const _U1&, const _U2&>()), std::tuple<_T1, _T2>&> std::tuple<_T1, _T2>::operator=(const std::tuple<_U1, _U2>&) [with _U2 = _U1; _T1 = int&; _T2 = int&]'
 2355 |         operator=(const tuple<_U1, _U2>& __in)
      |         ^~~~~~~~
/usr/include/c++/14/tuple:2355:9: note:   template argument deduction/substitution failed:
a.cc:16:23: note:   '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, std::__cxx11::basic_string<char> > >, std::pair<int, std::__cxx11::basic_string<char> > >::value_type' {aka 'std::pair<int, std::__cxx11::basic_string<char> >'} is not derived from 'const std::tuple<_T1, _T2>'
   16 |     tie(b,a)=data.at(i);
      |                       ^
/usr/include/c++/14/tuple:2365:9: note: candidate: 'template<class _U1, class _U2> std::__enable_if_t<((bool)__assignable<_U1, _U2>()), std::tuple<_T1, _T2>&> std::tuple<_T1, _T2>::operator=(std::tuple<_U1, _U2>&&) [with _U2 = _U1; _T1 = int&; _T2 = int&]'
 2365 |         operator=(tuple<_U1, _U2>&& __in)
      |         ^~~~~~~~
/usr/include/c++/14/tuple:2365:9: note:   template argument deduction/substitution failed:
a.cc:16:23: note:   '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, std::__cxx11::basic_string<char> > >, std::pair<int, std::__cxx11::basic_string<char> > >::value_type' {aka 'std::pair<int, std::__cxx11::basic_string<char> >'} is not derived from 'std::tuple<_T1, _T2>'
   16 |     tie(b,a)=data.at(i);
      |                       ^
/usr/include/c++/14/tuple:2375:9: note: candidate: 'template<class _U1, class _U2> std::__enable_if_t<((bool)__assignable<const _U1&, const _U2&>()), std::tuple<_T1, _T2>&> std::tuple<_T1, _T2>::operator=(const std::pair<_U1, _U2>&) [with _U2 = _U1; _T1 = int&; _T2 = int&]'
 2375 |         operator=(const pair<_U1, _U2>& __in)
      |         ^~~~~~~~
/usr/include/c++/14/tuple:2375:9: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/14/bits/stl_pair.h:60,
                 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:
/usr/include/c++/14/type_traits: In substitution of 'template<bool _Cond, class _Tp> using std::__enable_if_t = typename std::enable_if::type [with bool _Cond = false; _Tp = std::tuple<int&, int&>&]':
/usr/include/c++/14/tuple:2375:2:   required by substitution of 'template<class _U1, class _U2> std::__enable_if_t<((bool)__assignable<const _U1&, const _U2&>()), std::tuple<int&, int&>&> std::tuple<int&, int&>::operator=(const std::pair<_T1, _T2>&) [with _U1 = int; _U2 = std::__cxx11::basic_string<char>]'
a.cc:16:23:   required from here
   16 |     tie(b,a)=data.at(i);
      |                       ^
/usr/include/c++/14/type_traits:138:11: error: no type named 'type' in 'struct std::enable_if<false, std::tuple<int&, int&>&>'
  138 |     using __enable_if_t = typename enable_if<_Cond, _Tp>::type;
      |           ^~~~~~~~~~~~~
/usr/include/c++/14/tuple:2386:9: note: candidate: 'template<class _U1, class _U2> std::__enable_if_t<((bool)__assignable<_U1, _U2>()), std::tuple<_T1, _T2>&> std::tuple<_T1, _T2>::operator=(std::pair<_U1, _U2>&&) [with _U2 = _U1; _T1 = int&; _T2 = int&]'
 2386 |         operator=(pair<_U1, _U2>&& __in)
      |         ^~~~~~~~
/usr/include/c++/14/tuple:2386:9: note:   template argument deduction/substitution failed:
/usr/include/c++/14/tuple:2332:7: note: candidate: 'std::tuple<_T1, _T2>& std::tuple<_T1, _T2>::operator=(std::__conditional_t<((bool)__assignable<const _T1&, const _T2&>()), const std::tuple<_T1, _T2>&, const std::__nonesuch&>) [with _T1 = int&; _T2 = int&; std::__conditional_t<((bool)__assignable<const _T1&, const _T2&>()), const std::tuple<_T1, _T2>&, const std::__nonesuch&> = const std::tuple<int&, int&>&]'
 2332 |       operator=(__conditional_t<__assignable<const _T1&, const _T2&>(),
      |       ^~~~~~~~
/usr/include/c++/14/tuple:2334:52: note:   no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, std::__cxx11::basic_string<char> > >, std::pair<int, std::__cxx11::basic_string<char> > >::value_type' {aka 'std::pair<int, std::__cxx11::basic_string<char> >'} to 'std::__conditional_t<true, const std::tuple<int&, int&>&, const std::__nonesuch&>' {aka 'const std::tuple<int&, int&>&'}
 2332 |       operator=(__conditional_t<__assignable<const _T1&, const _T2&>(),
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 2333 |                                 const tuple&,
      |                                 ~~~~~~~~~~~~~       
 2334 |                                 const __nonesuch&> __in)
      |                                 ~~~~~~~~~~~~~~~~~~~^~~~
/usr/include/c++/14/tuple:2343:7: note: candidate: 'std::tuple<_T1, _T2>& std::tuple<_T1, _T2>::operator=(std::__conditional_t<((bool)__assignable<_T1, _T2>()), std::tuple<_T1, _T2>&&, std::__nonesuch&&>) [with _T1 = int&; _T2 = int&; std::__conditional_t<((bool)__assignable<_T1, _T2>()), std::tuple<_T1, _T2>&&, std::__nonesuch&&> = std::tuple<int&, int&>&&]'
 2343 |       operator=(__conditional_t<__assignable<_T1, _T2>(),
      |       ^~~~~~~~
/usr/include/c++/14/tuple:2345:47: note:   no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, std::__cxx11::basic_string<char> > >, std::pair<int, std::__cxx11::basic_string<char> > >::value_type' {aka 'std::pair<int, std::__cxx11::basic_string<char> >'} to 'std::__conditional_t<true, std::tuple<int&, int&>&&, std::__nonesuch&&>' {aka 'std::tuple<int&, int&>&&'}
 2343 |       operator=(__conditional_t<__assignable<_T1, _T2>(),
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 2344 |                                 tuple&&,
      |                                 ~~~~~~~~       
 2345 |                                 __nonesuch&&> __in)
      |                                 ~~~~~~~~~~~~~~^~~~