T1:
on both sides would be finished with the logarithmic
T2:
the difference will be found, in fact, left the mobile digital, and can only be moved k steps
would be simple, the number of congruence k mold must be moved together, it certainly will not do different, so open k barrels statistics on the line
T3:
for each node seeking contributions
can the distribution of nodes in sequence for each node in the statistical sub-tree
specifically can be used to solve the tree line, statistics which position has emerged at the same time count the number of consecutive sub-segments
so the contribution of each node is the \ ((cnt_u- \ sum_ {v \ to son_u} cnt_v) * val_u \)
csp-s Analog 94
Guess you like
Origin www.cnblogs.com/Gkeng/p/11839513.html
Recommended
Ranking