Problem 3608 · Medium

Minimum Time for K Connected Components

Add the edges back in order of decreasing removal time with union-find; the component count recorded before each time group gives the answer.

Open the interactive visualisation