정석적인 다익스트라 문제 import sys input = sys.stdin.readline from heapq import heappop,heappush def dijkstra(start): min_dists[start] = 0 heap = [] heappush(heap,[0,start]) while heap: cur_dists, cur_node = heappop(heap) for next_node,next_dist in graph[cur_node]: if min_dists[next_node] > cur_dists + next_dist: min_dists[next_node] = cur_dists + next_dist heappush(heap,[min_dists[next_node],next_node]) ..