func_code_string: #include <bits/stdc++.h>   using namespace std;   struct edge {     int index;     int disc, exit;     int val;     int depth;   };   int n, m;   edge e[200010];   vector<int> V[200010];   int disc = 1;   void calc_disc(int curr, int par, int depth) {     e[curr].disc = disc++;     e[curr].depth = depth;     for (int i = 0; i < V[curr].size(); i++) {       int next = V[curr][i];       if (next == par) continue;       calc_disc(next, curr, depth + 1);     }     e[curr].exit = disc++;   }   bool pro(const edge &e1, const edge &e2) { return e1.disc < e2.disc; }   int loga1[200010 * 2], loga2[200010 * 2];   int index_inv[200010];   void update(int x, int val, int log[]) {     for (; x < 200010 * 2; x += x & -x) log[x] += val;   }   int read(int x, int log[]) {     int rez = 0;     for (; x > 0; x -= x & -x) {       rez += log[x];     }     return rez;   }   int main() {     scanf( %d%d , &n, &m);     for (int i = 1; i <= n; i++) {       scanf( %d , &e[i].val);       e[i].index = i;     }     for (int i = 0; i < n - 1; i++) {       int p1, p2;       scanf( %d%d , &p1, &p2);       V[p1].push_back(p2);       V[p2].push_back(p1);     }     calc_disc(1, -1, 1);     sort(e + 1, e + n + 1, pro);     for (int i = 1; i <= n; i++) {       index_inv[e[i].index] = i;     }     for (int i = 0; i < m; i++) {       int p;       scanf( %d , &p);       if (p == 1) {         int x, val;         scanf( %d%d , &x, &val);         edge tmp = e[index_inv[x]];         if (tmp.depth % 2 == 1) val *= -1;         update(tmp.disc, val, loga1);         update(tmp.disc, -val, loga2);         update(tmp.exit, -val, loga1);         update(tmp.exit, val, loga2);       }       if (p == 2) {         int x;         scanf( %d , &x);         edge tmp = e[index_inv[x]];         if (tmp.depth % 2 == 0)           printf( %d n , read(tmp.disc, loga1) + tmp.val);         else           printf( %d n , read(tmp.disc, loga2) + tmp.val);       }     }     return 0;   }   