Help me to solve this graph problem

Revision en2, by Just_LOL, 2024-06-13 09:06:14

Problem link I used dijkstra's algorithm and when I get a new bicycle with minimum slowness factor or when I reached a city with minimum time I updated the distance array. This was my submission. But it didn't work. I saw many people use 2d distance array. But I can't figure out the intuition? Could you explain me the intuition. If there is any other way to do this could you comment that one too.

Tags graphs, help

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English Just_LOL 2024-06-13 09:06:14 5 Tiny change: 'his could me comment t' -> 'his could you comment t'
en1 English Just_LOL 2024-06-09 06:53:16 545 Initial revision (published)