func_code_string: #include <bits/stdc++.h>   using namespace std;   const int MAXN = 100005;   int N, M;   int pwr[MAXN], jump[MAXN], cnt[MAXN];   int len;   void recalc(int pos) {     int nxt = pos + pwr[pos];     if (nxt < N && (nxt / len) == (pos / len)) {       jump[pos] = jump[nxt];       cnt[pos] = cnt[nxt] + 1;     } else {       jump[pos] = nxt;       cnt[pos] = 1;     }   }   int main(int argc, char *argv[]) {     scanf( %d%d , &N, &M);     for (int i = 0, _i = N; i < _i; ++i) {       scanf( %d , pwr + i);     }     len = (int)sqrt((double)N);     for (int i = N - 1; i >= 0; i--) {       recalc(i);     }     for (int i = 0, _i = M; i < _i; ++i) {       int type, a;       scanf( %d%d , &type, &a);       --a;       if (type) {         int cur = a, ret = 0;         while (true) {           ret += cnt[cur];           if (jump[cur] >= N) break;           cur = jump[cur];         }         while (cur + pwr[cur] < N) cur += pwr[cur];         printf( %d %d n , cur + 1, ret);       } else {         int b;         scanf( %d , &b);         pwr[a] = b;         int ablock = a / len;         for (int i = a; i >= 0 && (i / len) == ablock; i--) recalc(i);       }     }     return 0;   }   