func_code_string: #include <bits/stdc++.h>   using namespace std;   int n, q;   int a[1000010];   int d[1000010];   int lowbit(int x) { return x & -x; }   void update(int x, int v) {     while (x <= n) {       d[x] += v;       x += lowbit(x);     }   }   int query(int x) {     int res = 0;     while (x) {       res += d[x];       x -= lowbit(x);     }     return res;   }   int main() {     scanf( %d%d , &n, &q);     for (int i = 1; i <= n; i++) {       scanf( %d , &a[i]);       update(a[i], 1);     }     while (q--) {       int k;       scanf( %d , &k);       if (k > 0)         update(k, 1);       else {         k = -k;         int l = 1, r = n, pos = -1;         while (l <= r) {           int mid = (l + r) >> 1;           if (query(mid) < k) {             l = mid + 1;           } else {             r = mid - 1;             pos = mid;           }         }         if (pos != -1) update(pos, -1);       }     }     int ans = -1;     for (int i = 1; i <= n; i++) {       if (query(i) - query(i - 1)) {         ans = i;         break;       }     }     printf( %d , (ans == -1 ? 0 : ans));     return 0;   }   