Shortest Path with Color Transformations: Solving the JOI 2021 Final Robot Problem
We are given a connected undirected graph (or possibly disconnected) with N vertices and M edges. Each edge e connects u and v, has an integer color c, and a cost p for traversing it. However, at any vertex, if multiple incident edges share the same color, the robot cannot decide which path to take....