Operations on a tree
3282 Tree
Delete Edge, double edge, single point of modification, ask for path XOR or.
1984: Under the Moon "Mao Jingxiu"
Path overlay, path increase, ask path Max
Simple Tree Profile
3306: The Tree
To support the root change, modify the point right, query the subtree minimum value
Do not change the root is a simple DFS sequence segment tree, the root of the word only need to know the current root and query the relationship between the point: if the query point is the son of the root, then direct inquiry can be, if the inquiry point is the root, then the output sum; otherwise the root must be in a subtree of the query point, So this time we have to query the original tree in addition to this subtrees tree all other points of Min, and this can be used in the line segment tree to ask two implementations ([1, start[son[x]]) ∪ (End[son[x]], n])
3083: A faraway country
As in the previous question, but to support path modification, it is only extended to the tree section.
Spoj Cot
Two-point path K-Small
The DFS sequence establishes a persistent weight segment tree for each point-to-root path, and then the LCA can be done.
3123: [Sdoi2013] Forest
Same as above, but with one more merge operation.
Each heuristic is merged and then violent reconstruction is possible.
Because a point is merged at most Logn times, each merge is Logn, so the total complexity nlog^2n
Some data structure problems