[20250203] BOJ / 골드2 / 등산 / 권혁준 #18
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/1486
🧭 풀이 시간
25분
👀 체감 난이도
✏️ 문제 설명
2차원 격자가 있고, 각 칸마다 높이(0 ~ 51)가 존재합니다.$T$ 이하인 곳으로만 이동할 수 있고, 이동하는 데 $\max(1, (높이 차이^2))$ 만큼의 시간이 걸립니다.
이동할 때는 인접한 상하좌우 중, 높이 차이가
(0,0)에서 출발해서 시간$D$ 이내에 다시 (0,0)으로 오려 합니다. 이 때 갈 수 있는 가장 높은 곳의 높이를 구해야 합니다.
🔍 풀이 방법
⏳ 회고
처음엔 3차원으로 둘 요소로 이동 시간을 생각해봤다가 25 * 25 * 1000000이라 시간 초과가 날 것 같아서 자연스럽게 다른 걸 생각해보게 되었습니다
높이 가짓수가 적다는 걸 관찰했고, 25 * 25 * 52로 줄일 수 있었습니다.