Notice
Recent Posts
Recent Comments
Link
목록1238 (1)
나의 개발일지
문제 : https://www.acmicpc.net/problem/1238 🔑 다익스트라 각 마을에서 도착지까지의 거리를 저장 [INF, 1, 0, 3, 7] 도착지에서 각 마을까지의 거리를 저장 [ 0, 4, 0, 6, 3] 그래서 총 n번의 다익스트라를 진행 0번 인덱스 제외 각 인덱스의 합이 가장 큰 거리가 정답 from collections import defaultdict from heapq import heappush, heappop n, m, x = map(int, input().split()) # n명 학생(마을), m개의 단방향 도로, x도착지 graph = defaultdict(list) for i in range(m): s, e, t = map(int, input().split()) ..
백준
2023. 11. 1. 14:21