코드 import sys, heapq # 다익스트라 알고리즘은 heap 자료구조를 이용 input = sys.stdin.readline INF = 100000 * 100000 + 1 # INF의 크기, 987654321로 잡았을 때는 틀렸다. # 이 값을 어떻게 구할지 생각해봐야겠다. n,m = map(int, input().split()) junctions = [*map(int, input().split())] # 분기점 graph = [[] for _ in range(n)] # 양방향 그래프 visited = [INF]*n # 가중치가 양수라서 다익스트라 알고리즘 사용가능 for _ in range(m): a,b,t = map(int,input().split()) graph[a].append((b,t..