func_code_string: #include <bits/stdc++.h>   using namespace std;   typedef vector<int> vi;   typedef pair<int, int> ii;   using namespace std;   int n, q, len = 0, nxt[100005], nxtb[100005], disb[100005];   int main() {     int a, b, c, op;     scanf( %d%d , &n, &q);     len = n / 327 + 1;     for (int i = 1; i <= n; ++i) {       scanf( %d , &a);       if (i + a <= n)         nxt[i] = i + a;       else         nxt[i] = n + 1;     }     for (int i = 1; i <= n; i += 327) {       b = min(n, i + 327 - 1);       for (int j = b; j >= i; --j) {         if (nxt[j] <= b) {           nxtb[j] = nxtb[nxt[j]];           disb[j] = disb[nxt[j]] + 1;         } else {           nxtb[j] = j;           disb[j] = 1;         }       }     }     while (q--) {       scanf( %d , &op);       if (op == 0) {         scanf( %d%d , &a, &b);         if (a + b <= n)           nxt[a] = a + b;         else           nxt[a] = n + 1;         b = a / 327 * 327;         c = min(n, b + 327);         for (int i = a; i > b; --i) {           if (nxt[i] <= c) {             nxtb[i] = nxtb[nxt[i]];             disb[i] = disb[nxt[i]] + 1;           } else {             nxtb[i] = i;             disb[i] = 1;           }         }       } else if (op == 1) {         scanf( %d , &a);         b = disb[a];         a = nxtb[a];         while (nxt[a] <= n) {           b += disb[nxt[a]];           a = nxtb[nxt[a]];         }         printf( %d %d n , a, b);       } else         assert(0);     }     return 0;   }   