Skip to content

Conversation

@lkhyun
Copy link
Contributor

@lkhyun lkhyun commented Aug 25, 2025

🧷 문제 링크

https://www.acmicpc.net/problem/27978

🧭 풀이 시간

30분

👀 체감 난이도

✏️ 문제 설명

2차원 배열에서 특정 지점에서 시작해서 도착지로 최소 비용으로 가는거.
이때 가중치가 0또는 1

🔍 풀이 방법

0-1 BFS
다익스트라처럼 구현하나 가중치가 0 또는 1이므로 우선 순위 큐를 사용하지 않고
덱을 사용하여 0일때는 앞에 1일때는 뒤에 넣으므로써 O(ElogV)가 아니라 O(E+V)로 구할 수 있음.

⏳ 회고

다익스트라랑 그리 다를게 없어서 어렵진 않았던 것 같다.

@ShinHeeEul ShinHeeEul merged commit 9a85e3a into main Aug 25, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants