Back to problems

Minimum Fuel Cost Across a Road Network

Algorithm · Microsoft · Hard

Cheapest Fuel Route Hard · Topics · Company Tags · Hints There are n cities labeled 1 through n, connected by m two‑way roads. Each road is described by a triple (u, v, w) meaning the direct connection between cities u and v consumes exactly w units of fuel when traversed in either direction. In city i, one unit of fuel costs price[i]. A vehicle starts at city A with no fuel on board, but it has unlimited storage and may purchase any amount of fuel at any city it visits.…

Checking your access…