Language: C++

#include <iostream>
#include <cstring>
#include <stdlib.h>
#include <vector>
#include <algorithm>
#include <cmath>
#include <stack>
#include <queue>
#include <math.h>
#include <string>
#include <map>
#include <iomanip>
using namespace std;

typedef long long ll;
typedef pair<int, int> P;

void print_vector(vector<ll> vt){
    for(auto v: vt){
        cout << v;
    }
    cout << endl;
}

int N;
vector<ll> X(2000010);

int main()
{
    cin >> N;
    for(int i=0; i<N; i++){
        cin >> X[i];
    }
    for(int i=0; i<N; i++){
        vector<ll> tmp;
        copy(X.begin(), X.end(), tmp);
        tmp.erase(tmp.begin()+i);
        sort(tmp.begin(), tmp.end(), greater<ll>());
        cout << tmp[N/2-1] << endl;

    }

    return 0;
}


Compiler output:
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'static _OI std::__copy_move<false, false, std::random_access_iterator_tag>::__copy_m(_II, _II, _OI) [with _II = long long int*; _OI = std::vector<long long int>]':
/usr/include/c++/14/bits/stl_algobase.h:521:30:   required from '_OI std::__copy_move_a2(_II, _II, _OI) [with bool _IsMove = false; _II = long long int*; _OI = vector<long long int>]'
  520 |       return std::__copy_move<_IsMove, __memcpyable<_OI, _II>::__value,
      |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  521 |                               _Category>::__copy_m(__first, __last, __result);
      |                               ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:548:42:   required from '_OI std::__copy_move_a1(_II, _II, _OI) [with bool _IsMove = false; _II = long long int*; _OI = vector<long long int>]'
  548 |     { return std::__copy_move_a2<_IsMove>(__first, __last, __result); }
      |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:556:31:   required from '_OI std::__copy_move_a(_II, _II, _OI) [with bool _IsMove = false; _II = __gnu_cxx::__normal_iterator<long long int*, vector<long long int> >; _OI = vector<long long int>]'
  556 |                 std::__copy_move_a1<_IsMove>(std::__niter_base(__first),
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
  557 |                                              std::__niter_base(__last),
      |                                              ~~~~~~~~~~~~~~~~~~~~~~~~~~
  558 |                                              std::__niter_base(__result)));
      |                                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:651:7:   required from '_OI std::copy(_II, _II, _OI) [with _II = __gnu_cxx::__normal_iterator<long long int*, vector<long long int> >; _OI = vector<long long int>]'
  650 |       return std::__copy_move_a<__is_move_iterator<_II>::__value>
      |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  651 |              (std::__miter_base(__first), std::__miter_base(__last), __result);
      |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:36:13:   required from here
   36 |         copy(X.begin(), X.end(), tmp);
      |         ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:403:15: error: no match for 'operator*' (operand type is 'std::vector<long long int>')
  403 |               *__result = *__first;
      |               ^~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:405:15: error: no match for 'operator++' (operand type is 'std::vector<long long int>')
  405 |               ++__result;
      |               ^~~~~~~~~~