func_code_string: #include <bits/stdc++.h>   using namespace std;   vector<int> disTime, finTime, depth, a;   vector<vector<int> > graph;   int n, maxSize, tr0[200005], tr1[200005];   vector<bool> vis;   int tim;   void update(int in, int val, int* tr) {     while (in <= maxSize) {       tr[in] += val;       in += (in & (-in));     }   }   int getSum(int in, int* tr) {     int sum = 0;     while (in) {       sum += tr[in];       in -= (in & (-in));     }     return sum;   }   void dfs(int idx, int d) {     vis[idx] = true;     depth[idx] = d;     disTime[idx] = tim++;     for (auto ch : graph[idx]) {       if (vis[ch]) continue;       dfs(ch, d + 1);     }     finTime[idx] = tim;   }   int main() {     int m, u, v, x;     cin >> n >> m;     a.resize(n);     graph.resize(n);     for (int i = 0; i < n; i++) cin >> a[i];     for (int i = 0; i < n - 1; i++) {       scanf( %d %d , &u, &v);       graph[u - 1].push_back(v - 1);       graph[v - 1].push_back(u - 1);     }     disTime.resize(n);     finTime.resize(n);     depth.resize(n);     vis.resize(n);     tim = 1;     for (int i = 0; i < n; i++) vis[i] = false;     dfs(0, 0);     maxSize = tim;     for (int i = 0; i < maxSize + 1; i++) tr1[i] = tr0[i] = 0;     for (int i = 0; i < m; i++) {       scanf( %d , &x);       switch (x) {         case 1:           scanf( %d %d , &u, &v);           if (depth[u - 1] % 2) {             update(disTime[u - 1], v, tr1);             update(finTime[u - 1], -v, tr1);             update(disTime[u - 1], -v, tr0);             update(finTime[u - 1], v, tr0);           } else {             update(disTime[u - 1], v, tr0);             update(finTime[u - 1], -v, tr0);             update(disTime[u - 1], -v, tr1);             update(finTime[u - 1], v, tr1);           }           break;         case 2:           scanf( %d , &u);           if (depth[u - 1] % 2)             printf( %d n , (a[u - 1] + getSum(disTime[u - 1], tr1)));           else             printf( %d n , (a[u - 1] + getSum(disTime[u - 1], tr0)));           break;       }     }     disTime.clear();     finTime.clear();     depth.clear();     vis.clear();     graph.clear();     a.clear();     return 0;   }   