func_code_string: #include <bits/stdc++.h>   using namespace std;   const int MAXN = 2e5 + 10;   int fn[2][MAXN], a[2][MAXN], ans[MAXN], fans[MAXN];   void add(int p, int val, int id) {     for (++p; p < MAXN; p += p & (-p)) fn[id][p] += val;   }   int get(int p, int id) {     int res = 0;     for (; p > 0; p -= p & (-p)) res += fn[id][p];     return res;   }   int calc(int ind, int n) {     if (ind == n) return 0;     int rem = calc(ind + 1, n), REM = 0;     int id1 = get(a[0][ind], 0), id2 = get(a[1][ind], 01);     if (id1 + id2 + rem >= n - ind) REM = 1;     ans[ind] = (id1 + id2 + rem) % (n - ind);     add(a[0][ind], 1, 0);     add(a[1][ind], 1, 1);     return REM;   }   int main() {     ios::sync_with_stdio(false);     cin.tie(0);     int n;     cin >> n;     for (int i = 0; i < n; i++) cin >> a[0][i];     for (int i = 0; i < n; i++) cin >> a[1][i];     calc(0, n);     for (int i = 0; i < n; i++) {       int num = ans[i] + 1;       int l = -1, r = n - 1;       while (r - l > 1) {         int mid = (l + r) / 2;         if (get(mid + 1, 0) >= num)           r = mid;         else           l = mid;       }       fans[i] = r;       add(r, -1, 0);     }     for (int i = 0; i < n; i++) cout << fans[i] <<    ;     cout << endl;     return 0;   }   