로딩
요청 처리 중입니다...

삼성 코테 준비 with 추가 알고리즘

 삼성 코테 준비 with 추가 알고리즘

다익스트라(dijkstra) import heapq def dijkstra(start): distance = [float('INF')]*(N+1) distance[start] = 0 q = [] heapq.heappush((q, (distance[start], start))) while q: now_dist, now_node = heapq.heappop(q) if distance[now_node]

# 삼성코테준비 # 알고리즘 # 파이썬