목록1916 (1)
컴공생의 다이어리
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/bb5OH0/btrG5r9uUkU/BBym8fMvlbHKuVgYleixKK/img.png)
백준 1916번 : 최소비용 구하기 (문제 바로가기) 내 코드 import sys, heapq from collections import defaultdict input = sys.stdin.readline INF = int(1e9) n = int(input()) # 도시의 개수 m = int(input()) # 버스의 개수 graph = defaultdict(list) # 버스 정보 for _ in range(m): s, e, c = map(int, input().split()) graph[s].append((e, c)) start, end = map(int, input().split()) # 출발점과 도착점 도시번호 distance = [INF] * (n + 1) queue = [] heapq.hea..
Development/Algorithm & Coding Test
2022. 7. 20. 00:01