Problem 1135 · Medium

Connecting Cities With Minimum Cost

Connect every city with the cheapest set of roads, or report that this cannot be done. Roads are added in cost order, skipping any that would form a loop.

Open the interactive visualisation