Help with code forces problem

problem link
solution link
my 31 case goes wrong please tell what wrong i am doing.

You know you can look at the test case right?

since node are 100000 its hard to visualize.

Use LL / ULL to store the distances. With the given constraints, the values can easily overflow INT type. I made the required changes (along with increasing the value of INF), and it was accepted.

yeah man, thnx…