미확인도착지

· 백준
코드 import heapq, sys input = sys.stdin.readline INF = 987654321 # 다익스트라 알고리즘 def dijkstra(x,graph): visited = [INF]*(n+1) queue = [(0,x)] visited[x] = 0 while queue: cost, now = heapq.heappop(queue) if cost > visited[now]: continue for i in graph[now]: newcost = cost + i[1] if visited[i[0]] > newcost: visited[i[0]] = newcost heapq.heappush(queue, (newcost, i[0])) return visited tc = int(input())..