func_code_string: #include <bits/stdc++.h>   using namespace std;   const int MAX = 200005;   pair<int, int> a[MAX];   int bin_Upper(vector<pair<int, int> >& a, int l, int r, int x, int last) {     int m = (l + r) / 2;     if (l > r) return last;     if (x > a[m].second) return bin_Upper(a, m + 1, r, x, last);     if (x <= a[m].second) return bin_Upper(a, l, m - 1, x, m);   }   int main() {     int n, q, cmd, p, x;     cin >> n;     for (int i = 0; i < n; i++) {       cin >> a[i].first;       a[i].second = 0;     }     cin >> q;     vector<pair<int, int> > stak;     for (int k = 1; k <= q; k++) {       cin >> cmd;       if (cmd == 1) {         cin >> p >> x;         a[p - 1] = {x, k};       } else {         cin >> x;         while (!stak.empty() && stak.back().first <= x) stak.pop_back();         stak.push_back({x, k});       }     }     for (int i = 0; i < n; i++) {       int temp = bin_Upper(stak, 0, stak.size() - 1, a[i].second, -1);       if (temp == -1 || stak[temp].first <= a[i].first)         cout << a[i].first <<    ;       else         cout << stak[temp].first <<    ;     }     return 0;   }   