CORONA - Editorial

My approach was something like:-
Initially all the nodes till N will have a distance of INF and when I will process the K nodes , I will assign the distance of those K nodes with the distance provided in query. For example if the ith node has a distance of INF initially and then in a query the testing cost of ith code is X then I will replace distance of Ith node with X instead of INF.
Then I will push all the vertices into the set which are not having a distance of INF.
From there I just run a simple Dijkstra algorithm.
My code is getting partially correct and in some cases TLE.
code:-CodeChef: Practical coding for everyone
Can anyone please provide me with some counter case.
Thanks in advance for help.