2022하계모각코 5주차 결과
import sys import heapq inf = sys.maxsize v, e = map(int, sys.stdin.readline().split()) g = [[] for _ in range(v + 1)] k = int(sys.stdin.readline()) for i in range(e): a, b, c = map(int, sys.stdin.readline().split()) g[a].append([c, b]) result = [inf for _ in range(v + 1)] result[k] = 0 q = [] heapq.heappush(q, [0, k]) while q: dis, end = heapq.heappop(q) for d, x in g[end]: d += dis if d < resu..