func_code_string: #include <bits/stdc++.h>   using namespace std;   const int N = 1e5 + 5;   int tree[N << 2], Max[N << 2], Min[N << 2], cnt;   bool fu[N << 2];   pair<int, int> a[N];   void build(int l, int r, int rt) {     if (l == r) {       tree[rt] = a[l].first;       Max[rt] = Min[rt] = tree[rt];       return;     }     int m = (l + r) >> 1;     build(l, m, rt << 1);     build(m + 1, r, rt << 1 | 1);     Max[rt] = max(Max[rt << 1], Max[rt << 1 | 1]);     Min[rt] = min(Min[rt << 1], Min[rt << 1 | 1]);   }   bool qu(int f, int x, int rt) {     int ma, mi;     ma = Max[rt], mi = Min[rt];     if ((f ==  >  && mi > x) || (f ==  <  && ma < x))       return true;     else       return false;   }   bool qu2(int f, int x, int rt) {     int ma, mi;     ma = Max[rt], mi = Min[rt];     if ((f ==  >  && ma > x) || (f ==  <  && mi < x))       return true;     else       return false;   }   void ff(int rt) {     fu[rt] = !fu[rt];     swap(Max[rt], Min[rt]);     Max[rt] *= -1;     Min[rt] *= -1;   }   void updata(int l, int r, int rt, char f, int x) {     if (qu(f, x, rt)) {       ff(rt);       return;     }     int m = (l + r) >> 1;     if (fu[rt]) ff(rt << 1), ff(rt << 1 | 1), fu[rt] = 0;     if (qu2(f, x, rt << 1)) updata(l, m, rt << 1, f, x);     if (qu2(f, x, rt << 1 | 1)) updata(m + 1, r, rt << 1 | 1, f, x);     Max[rt] = max(Max[rt << 1], Max[rt << 1 | 1]);     Min[rt] = min(Min[rt << 1], Min[rt << 1 | 1]);   }   int ans[N];   void print(int l, int r, int rt) {     if (l == r) {       if (fu[rt]) tree[rt] *= -1;       ans[a[l].second] = tree[rt];       return;     }     int m = (l + r) >> 1;     if (fu[rt]) ff(rt << 1), ff(rt << 1 | 1), fu[rt] = 0;     print(l, m, rt << 1);     print(m + 1, r, rt << 1 | 1);   }   int main() {     int n, q;     cin >> n >> q;     for (int i = 1; i <= n; i++) cin >> a[i].first, a[i].second = i;     sort(a + 1, a + n + 1);     build(1, n, 1);     while (q--) {       char f;       int x;       cin >> f >> x;       updata(1, n, 1, f, x);     }     print(1, n, 1);     for (int i = 1; i <= n; i++) printf( %d  , ans[i]);     printf(  n );     return 0;   }   