I was solving this question from the recent contest Biteration 3 . https://www.codechef.com/BIT32020/problems/BIT3E
In djisktra algo , we always chose the minimum dis unvisited node in every iteration , so i had declared a done array to keep track of unvisited nodes and put the nodes in a priority queue . But using this approach gives WA.
Now , if I dont keep track of the unvisited nodes , then it somehow gives correct answer https://www.codechef.com/viewsolution/34835179
I am curious to know what is the reason for this behavior . Maybe if someone can point a testcase for difference.
PS : In both the above submission please look at the section labelled as “See this section”