|вернуться в форум|
WA on Case#14
Passed all the test given in the discussion
I ran 1 bfs from 'r' and another bfs from 's' where i also kept data for those nodes who can have multiple parents.
than I while restoring path from destination to source I selected the node who has higher level from 'r' (that selection occurs if only the node has possibility multiple parents)
returned the ans which is the minimum among the final path