WINTER using djkstra

Problem link

This is my My submission.
(Ignore the initial extra lines of code, scroll down to
solve():slight_smile:

While everyone is doing bfs, I am using djkstra here. I’m precalculating the queries of type 1 and 2. Later answer 3.

Djkstra is considering a pseudo node 0, which is frozen and connects each node of type 1 query. Where time is the edge weights.

It fails 12 testicles out of 20, I cannot find the fault, please help!