func_code_string: #include <bits/stdc++.h>   using namespace std;   const int maxn = 1e6 + 5;   int n, q;   int a[maxn], b[maxn], f[maxn], g[maxn][30];   int c(int l, int r) {     int k = (int)log2(r - l + 1);     return max(g[l][k], g[r - (1 << k) + 1][k]);   }   void solve() {     cin >> n;     for (int i = 1; i <= n; ++i) cin >> a[i];     cin >> q;     for (int i = 1; i <= q; ++i) {       int id, p, first;       cin >> id;       if (id == 1) {         cin >> p >> first;         a[p] = first;         b[p] = i;       } else         cin >> f[i];     }     for (int i = 1; i <= q; ++i) g[i][0] = f[i];     int m = (int)log2(q) + 1;     for (int j = 1; j <= m; ++j)       for (int i = 1; i + (1 << (j - 1)) - 1 <= q; ++i)         g[i][j] = max(g[i][j - 1], g[i + (1 << (j - 1))][j - 1]);     for (int i = 1; i <= n; ++i) cout << max(a[i], c(max(1, b[i]), q)) <<    ;   }   int main() { solve(); }   