func_code_string: #include <bits/stdc++.h>   #pragma comment(linker,  /STACK:66777216 )   using namespace std;   typedef double LD;   const int N = 250000 + 5;   int n;   int b[N];   long long a[N];   const int L = 200;   const int E = N / L + 10;   long long mi[2][E];   long long S[2][E];   long long ad[E];   void F(int in) {     int s = in * L, f = min(n, (in + 1) * L);     S[0][in] = 0;     S[1][in] = 0;     mi[0][in] = 1;     mi[1][in] = 0;     for (int i = s; i < f; ++i) {       int ty = (i - s) % 2;       if (i - s <= 1) {         mi[ty][in] = a[i];         if (i != s) mi[ty][in] -= a[i - 1];         S[ty][in] += mi[ty][in];       } else {         S[ty][in] += a[i] - a[i - 1];         mi[ty][in] = min(mi[ty][in], S[ty][in]);       }     }   }   void updateblock(int j, int k) {     ad[j] += k;     S[0][j] += k;     mi[0][j] += k;   }   void update(int in, int l, int r, int k) {     int s = in * L, f = min(n, (in + 1) * L);     for (int i = s; i < f; ++i) a[i] += ad[in];     ad[in] = 0;     for (int i = l; i <= r; ++i) a[i] += k;     F(in);   }   void get(int in, int l, int r, long long s[2], long long mi[2]) {     s[0] = 0;     s[1] = 0;     mi[0] = 1;     mi[1] = 0;     for (int i = l; i <= r; ++i) {       int ty = (i - l) % 2;       if (i - l <= 1) {         mi[ty] = a[i] + ad[in];         if (i != l) mi[ty] -= a[i - 1] + ad[in];         s[ty] += mi[ty];       } else {         s[ty] += a[i] - a[i - 1];         mi[ty] = min(mi[ty], s[ty]);       }     }   }   int possible(int l, int r) {     int inl = l / L;     int inr = r / L;     long long gs[2], gmi[2];     if (inl == inr) {       get(inl, l, r, gs, gmi);     } else {       long long s[2];       long long mi[2];       get(inl, l, inl * L + L - 1, s, mi);       gs[0] = s[0], gs[1] = s[1];       gmi[0] = mi[0], gmi[1] = mi[1];       for (int j = inl + 1; j <= inr; ++j) {         int ty = (j * L - l) % 2;         long long val = ad[j - 1] + a[j * L - 1];         if (j != inr) {           s[0] = S[0][j];           s[1] = S[1][j];           mi[0] = ::mi[0][j];           mi[1] = ::mi[1][j];         } else {           get(inr, inr * L, r, s, mi);         }         if (ty == 0) {           gmi[0] = min(gmi[0], gs[0] + mi[0] - val);           gmi[1] = min(gmi[1], gs[1] + mi[1]);           gs[0] += s[0] - val;           gs[1] += s[1];         } else {           gmi[0] = min(gmi[0], gs[0] + mi[1]);           gmi[1] = min(gmi[1], gs[1] + mi[0] - val);           gs[0] += s[1];           gs[1] += s[0] - val;         }       }     }     if (l == r) {       return a[l] + ad[inl] == 1;     }     if (gmi[0] >= 1 && gmi[1] >= 0 &&         gs[(r - 1 - l) % 2] + (r - 1 - l) % 2 == a[r] + ad[inr])       return true;     return false;   }   void solve() {     scanf( %d , &n);     for (int i = 0; i < (int)(n); ++i) scanf( %d , &b[i]);     for (int i = 0; i < (int)(n); ++i) a[i] = b[i];     int m = (n + L - 1) / L;     for (int in = 0; in * L < n; ++in) F(in);     int Q;     scanf( %d , &Q);     for (int it = 1; it <= (int)(Q); ++it) {       int ty, l, r;       scanf( %d%d%d , &ty, &l, &r);       int k;       if (ty == 1) {         scanf( %d , &k);         int inl = l / L;         int inr = r / L;         for (int j = inl + 1; j <= inr - 1; ++j) {           updateblock(j, k);         }         if (inl == inr) {           update(inl, l, r, k);         } else {           update(inl, l, inl * L + L - 1, k);           update(inr, inr * L, r, k);         }       } else {         int res = possible(l, r);         printf( %d n , res);       }     }   }   void testgen() {     FILE* f = fopen( input.txt ,  w );     fclose(f);   }   int main() {     std::cout << std::fixed;     std::cout.precision(8);     std::cerr << std::fixed;     std::cerr.precision(3);     solve();     return 0;   }   