| ps | |
|---|---|
| 링크 | acmicpc.net/… |
| 출처 | BOJ |
| 문제 번호 | 14284 |
| 문제명 | 간선 이어가기 2 |
| 레벨 | 골드 5 |
| 분류 |
최단 경로 |
| 시간복잡도 | O(ElogV) |
| 인풋사이즈 | E<100,000, V<=5000 |
| 사용한 언어 | Python 3.11 |
| 제출기록 | 46736KB / 184ms |
| 최고기록 | 180ms |
| 해결날짜 | 2024/02/23 |
"""Solution code for "BOJ 14284. 간선 이어가기 2".
- Problem link: https://www.acmicpc.net/problem/14284
- Solution link: http://www.teferi.net/ps/problems/boj/14284
Tags: [dijkstra]
"""
import sys
from teflib import graph as tgraph
def main():
n, m = [int(x) for x in sys.stdin.readline().split()]
wgraph = tgraph.create_wgraph_from_input(n, m, dup_edge_selector_func=min)
s, t = [int(x) - 1 for x in sys.stdin.readline().split()]
print(tgraph.shortest_paths(wgraph, s, dest=t)[t])
if __name__ == '__main__':
main()