Here is the question-> REVERSE Problem - CodeChef
I have implemented the algo described in the editorial which is basically dijkstra’s algorithm but don’t know why i am getting WA.
here is my solution-> CodeChef: Practical coding for everyone
@swapnil159 The problem is with your implementation of Dijkstra’s algorithm.
More than my words I think this test case will tell you where the problem is:
Your this condition:
if will be true for all cases(not sure for all but for most cases because in your implementation you’ve used
for which kinda scares me). This is because you push all the nodes in the set
I think by now you may have understood where the problem is, but I can explain it more if still, it isn’t clear.
(Here is my submission: CodeChef: Practical coding for everyone)