func_code_string: #include <bits/stdc++.h>   using namespace std;   const int N = 200005;   int n, h, p[N], q[N], bit[N];   void update(int x, int v) {     for (; x < n; x += (x + 1) & -(x + 1)) bit[x] += v;   }   int sum(int x) {     int res = 0;     for (; x >= 0; x -= (x + 1) & -(x + 1)) res += bit[x];     return res;   }   void solve() {     fill(bit, bit + n, 0);     for (int i = n - 1; i >= 0; i--) {       int x = sum(p[i] - 1);       update(p[i], 1);       p[i] = x;     }     fill(bit, bit + n, 0);     for (int i = n - 1; i >= 0; i--) {       int x = sum(q[i] - 1);       update(q[i], 1);       q[i] = x;     }     for (int i = n - 1; i >= 0; i--) {       int c = (p[i] + q[i]) / (n - i);       p[i] = (p[i] + q[i]) % (n - i);       if (i > 0) {         p[i - 1] += c;       }     }     fill(bit, bit + n, 0);     for (int i = 0; i < n; i++) update(i, 1);     for (int i = 0; i < n; i++) {       if (i) printf(   );       int lo = 0, hi = n;       while (lo < hi) {         int m = lo + (hi - lo) / 2;         if (p[i] + 1 <= sum(m))           hi = m;         else           lo = m + 1;       }       printf( %d , lo);       update(lo, -1);     }     printf(  n );   }   int main() {     scanf( %d , &n);     for (int i = 0; i < n; i++) scanf( %d , p + i);     for (int i = 0; i < n; i++) scanf( %d , q + i);     solve();     return 0;   }   