Is my idea correct? [SOLVED]

For yesterday’s contest :

greedy uber driver problem:

What I have thought is modified dijkstra finding shortest path with maximum (minimum of all weights on path).

Solution Link:
https://www.codechef.com/viewsolution/29267801

But it shows WA.

Is my approach correct? If it is, then what might be causing WA?

Any helpful counter test-cases which break my code?

Thanks!

Solved! simple bfs with binary search! no dijkstra stuff needed!

1 Like