Problem 2737 · Medium

Find the Closest Marked Node

Run Dijkstra from the start vertex and stop at the first marked vertex that settles; its distance is the closest marked cost.

Open the interactive visualisation