Problem 3367 · Hard

Maximize Sum of Weights after Edge Removals

Tree DP with two totals per node, one for a removed parent edge and one for a kept parent edge, choosing the best child edges.

Open the interactive visualisation