[20251014] BOJ / P5 / 밤편지 / 설진영 #1120
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🧷 문제 링크
https://www.acmicpc.net/problem/23258
🧭 풀이 시간
1시간
👀 체감 난이도
✏️ 문제 설명
N개의 집이 있고, 반딧불이 s번 집에서 e번 집으로 이동함.
경유하는 집마다 2^X 방울의 이슬을 마셔야 하는데, 2^C 방울 이상 마시면 잠
각 쿼리마다 최소 시간 구하기
🔍 풀이 방법
플로이드-워셜 변형 + DP
dp[k][i][j] = 1번~k번 정점만 경유해서 i→j 최단거리
dp[k][i][j] = dp[k][i][j] dp[k+1][i][j] 중에 작은걸로다가
X번 집의 이슬 = 2^X 방울
C 미만 번호의 정점들만 경유 가능한지 체크하면 됨
⏳ 회고
어렵구만