Problem 2322 · Hard

Minimum Score After Removals on a Tree

Removing two tree edges makes three parts; with subtree XORs known, each pair of cut edges is scored in constant time.

Open the interactive visualisation