#yuki1065 from heapq import heappop,heappush import math def dijkstra(s,n,edge): dist=[float("inf")]*n dist[s]=0 used=[-1]*n hq=[[dist[s],s]] while hq: d,cur=heappop(hq) if dist[cur]