편집 시간: 2022년 2월 24일 오후 3:03

코드

Algorithm/13549.py at main · Junroot/Algorithm

풀이

bfs로 풀면되지만, 순간이동하는 경우에는 시간이 흐르지 않기 때문에 큐 대신 우선순위 큐를 사용하면 된다.