Language: C++

#pragma GCC optimize("Ofast")
#define _USE_MATH_DEFINES
#include "bits/stdc++.h"

using namespace std;

using u8 = uint8_t;
using u16 = uint16_t;
using u32 = uint32_t;
using u64 = uint64_t;
using i8 = int8_t;
using i16 = int16_t;
using i32 = int32_t;
using i64 = int64_t;

constexpr char newl = '\n';
constexpr double eps = 1e-10;

#define FOR(i,a,b) for (int i = (a); i < (b); i++)
#define F0R(i,b) FOR(i,0,b)
#define RFO(i,a,b) for (int i = ((b)-1); i >=(a); i--)
#define RF0(i,b) RFO(i,0,b)
#define fi first
#define se second
#define debug(x) cout << #x << ": " << x << '\n';
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()

template<typename T1, typename T2> inline void chmin(T1& a, T2 b) { if (a > b) a = b; }
template<typename T1, typename T2> inline void chmax(T1& a, T2 b) { if (a < b) a = b; }
template<class T> void Print(vector<T> v) {
  F0R(i, v.size()) {
    cout << v[i] << ' ';
  }
  cout << newl;
}

#if 1


// INSERT ABOVE HERE
signed main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);

  int N;
  cin >> N;
  vector<int> as(N);
  unordered_map<int,int> bs;
  F0R(i, N) {
    cin >> as[i];
  }
  F0R(i, N) {
    int a;
    cin >> a;
    bs[a]++;
  }
  vector<int> rs(N);
  F0R(i, N) {
    if (bs.begin()->first != as[i]) {
      rs[i] = bs.begin()->first;
      if (!(--bs.begin()->second)) {
        bs.erase(bs.begin());
      }
      continue;
    }
    if (bs.size() == 1) {
      cout << "No";
      return 0;
    }
    rs[i] = (--bs.end())->first;
    if (!(--(--bs.end())->second)) {
      bs.erase(--bs.end());
    }
  }
  cout << "Yes" << newl;
  F0R(i, N) {
    cout << rs[i] << ' ';
  }
}
#endif


Compiler output:
a.cc: In function 'int main()':
a.cc:71:14: error: no match for 'operator--' (operand type is 'std::unordered_map<int, int>::iterator' {aka 'std::__detail::_Insert_base<int, std::pair<const int, int>, std::allocator<std::pair<const int, int> >, std::__detail::_Select1st, std::equal_to<int>, std::hash<int>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<false, false, true> >::iterator'})
   71 |     rs[i] = (--bs.end())->first;
      |              ^~~~~~~~~~
a.cc:72:14: error: no match for 'operator--' (operand type is 'std::unordered_map<int, int>::iterator' {aka 'std::__detail::_Insert_base<int, std::pair<const int, int>, std::allocator<std::pair<const int, int> >, std::__detail::_Select1st, std::equal_to<int>, std::hash<int>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<false, false, true> >::iterator'})
   72 |     if (!(--(--bs.end())->second)) {
      |              ^~~~~~~~~~
a.cc:73:16: error: no match for 'operator--' (operand type is 'std::unordered_map<int, int>::iterator' {aka 'std::__detail::_Insert_base<int, std::pair<const int, int>, std::allocator<std::pair<const int, int> >, std::__detail::_Select1st, std::equal_to<int>, std::hash<int>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<false, false, true> >::iterator'})
   73 |       bs.erase(--bs.end());
      |                ^~~~~~~~~~