Problem 2662 · Medium

Minimum Cost of a Path With Special Roads

Treat the start, the target and every special road endpoint as points, then run Dijkstra with Manhattan walks and one-way roads.

Open the interactive visualisation