senshi2504's blog

By senshi2504, history, 4 years ago, In English

https://www.hackerearth.com/practice/algorithms/graphs/shortest-path-algorithms/practice-problems/algorithm/mancunian-goes-to-the-derby/description/ I am facing it tough to understand the editorial of this problem . I know it'll sound really simple for most of you . So can someone please explain the editorial to me , or tell me their own way of going about this problem. Any help is appreciated :)

 
 
 
 
  • Vote: I like it
  • 0
  • Vote: I do not like it

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Can someone please help me with this ...

»
4 years ago, # |
  Vote: I like it +8 Vote: I do not like it

You can use bfs to get minimal time you need to reach point N. Code

»
4 years ago, # |
  Vote: I like it +8 Vote: I do not like it

I am the setter of this problem. What did you not understand in the editorial? The crux is that the direction of each edge depends on the parity (odd or even) of the current time. So, for each vertex, we create two nodes to consider both cases. If you could perhaps explain in some more detail exactly the part which is unclear, maybe I could help. :)

»
4 years ago, # |
  Vote: I like it -18 Vote: I do not like it

Please star my projects and contribute if you are interested. 1. https://github.com/ArmenGabrielyan16/DiceRoller 2. https://github.com/ArmenGabrielyan16/SuperLibrary