Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin >> N;
  array<int,2> A;
  for(int i=0;i<N;i++){
    int a;
    cin >> a;
    A[i] = {a,i};
  }
  sort(&A[0], &A[N-1], [](auto& x, auto& y){return x[0] < y[0];});
  for(int i=0;i<N;i++){
    cout << A[i][1] << " " << endl;
  }
  return 0;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:10:16: error: cannot convert '<brace-enclosed initializer list>' to 'std::array<int, 2>::value_type' {aka 'int'} in assignment
   10 |     A[i] = {a,i};
      |                ^
a.cc:14:17: error: invalid types 'std::array<int, 2>::value_type {aka int}[int]' for array subscript
   14 |     cout << A[i][1] << " " << endl;
      |                 ^
a.cc: In instantiation of 'main()::<lambda(auto:28&, auto:29&)> [with auto:28 = int; auto:29 = int]':
/usr/include/c++/14/bits/predefined_ops.h:158:30:   required from 'constexpr bool __gnu_cxx::__ops::_Iter_comp_iter<_Compare>::operator()(_Iterator1, _Iterator2) [with _Iterator1 = int*; _Iterator2 = int*; _Compare = main()::<lambda(auto:28&, auto:29&)>]'
  158 |         { return bool(_M_comp(*__it1, *__it2)); }
      |                       ~~~~~~~^~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1777:14:   required from 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<main()::<lambda(auto:28&, auto:29&)> >]'
 1777 |           if (__comp(__i, __first))
      |               ~~~~~~^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1817:25:   required from 'void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<main()::<lambda(auto:28&, auto:29&)> >]'
 1817 |           std::__insertion_sort(__first, __first + int(_S_threshold), __comp);
      |           ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1908:31:   required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<main()::<lambda(auto:28&, auto:29&)> >]'
 1908 |           std::__final_insertion_sort(__first, __last, __comp);
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4805:18:   required from 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = int*; _Compare = main()::<lambda(auto:28&, auto:29&)>]'
 4805 |       std::__sort(__first, __last, __gnu_cxx::__ops::__iter_comp_iter(__comp));
      |       ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:12:7:   required from here
   12 |   sort(&A[0], &A[N-1], [](auto& x, auto& y){return x[0] < y[0];});
      |   ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:12:53: error: subscripted value is neither array nor pointer
   12 |   sort(&A[0], &A[N-1], [](auto& x, auto& y){return x[0] < y[0];});
      |                                                    ~^
a.cc:12:60: error: subscripted value is neither array nor pointer
   12 |   sort(&A[0], &A[N-1], [](auto& x, auto& y){return x[0] < y[0];});
      |                                                           ~^