Problem in djikstra algorithm code

please help me out in the code.I am trying to implement djikstra algorithm but dont know why the solution is not being accepted?

hello @TusHar-AroRa-2294450460870717
image

this will print distances only for those vertices that are directly / indirectly connected with source node.

to print for all vertices.
iterate from i= 1 to no of vertices.
check if i is present there in dist or not ,if not present then print -1 otherwise do what u were doing in above code

Please check out the changes at https://ide.codingblocks.com/s/244141 .Again getting WA.

your code is correct.
just print output for each test case in separate line.

Thank you…Got the right answer