Back
Tree DP: align leaf arrival times by only increasing edge weights. Compute the longest root-to-leaf path per subtree and pay the gap on each child branch.
algorithm
luogu
tree dp
tree