Templates - heavy chain split

https://www.luogu.org/problem/P3384

As stated, it is known comprising a tree of nodes N (without communication ring), each node comprising a numerical value, needs to support the following operations:
Operation 1: Format: XYZ 1 shows a tree from a node x to y minimum values of all nodes on the path are plus z
operation 2: format: 2 XY represents all the nodes on the tree request from node x to y and the values of the shortest path
operation 3: format: an xz 3 will be expressed as a root of x All nodes within the subtree plus z values
operation 4: format: 4 x values represent all nodes within the subtree root node seeking and at x

Guess you like

Origin www.cnblogs.com/Yinku/p/11309586.html
Recommended