When submitting a solution in C++, please select either C++14 (GCC 6-32) or C++17 (GCC 7-32) as your compiler. ×

typing_singh's blog

By typing_singh, history, 4 years ago, In English

https://cses.fi/problemset/task/1193

in this problem i m able to find out the minimum number of moves to get to the destination,but how to trace the path ,how to find string with shortest path. pls help!!
spookywooky -Baba_Yaga

  • Vote: I like it
  • -10
  • Vote: I do not like it

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

While creating the distance matrix you can also create an array p[] where you store for each vertex the parent of it whenever you update the distance matrix.

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

You can ask such questions in private message,no need to write a blog for it.