반응형 데이크스트라1 [백준/Python] 1753번 최단경로 문제https://www.acmicpc.net/problem/1753 소스코드import sysimport heapqinput = sys.stdin.readlineV, E = map(int, input().split())k = int(input())grape = {}for i in range(E): u, v, w = map(int, input().split()) if u not in grape: grape[u] = [] grape[u].append((v, w))def dijkstra(start): q = [] distance_list =[1e9 for i in range(V + 1)] heapq.heappush(q, (0, start)) distance_.. 2024. 11. 20. 이전 1 다음 728x90 반응형