hiho week 105 register

Ended

Participants:189

Verdict:Accepted
Score:100 / 100
Submitted:2016-07-05 10:21:45

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <cstdio>
#include <cstring>
using namespace std;
const int bign = 200033;
long long int sum[bign];
int id[bign];
int delta[bign];
int msize[bign];
int fa[bign];
int val[bign];
char op[2];
int ch[bign][2];
const int INF = 100000000;
int pid;
int n;
int mroot;
inline void push_down(int x)
{
    int tmp;
    if ((tmp = ch[x][0]))
    {
        delta[tmp] += delta[x];
    }
    if ((tmp = ch[x][1]))
    {
        delta[tmp] += delta[x];
    }
    val[x] += delta[x];
    delta[x] = 0;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX