[20251122] BOJ / G5 / 김밥천국의 계단 / 설진영 #1481
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/28069
🧭 풀이 시간
35분
👀 체감 난이도
✏️ 문제 설명
0번 계단에서 시작하여 정확히 K번의 행동으로 N번 계단에 도달해야 함
아래 행동 가능:
🔍 풀이 방법
BFS를 활용하여 각 계단에 도달하는 최소 횟수를 계산
1번 계단에서 지팡이를 두드리면 1 + floor(1/2) = 1로 제자리
-> N에 도달하는 최소 횟수가 K 이하이면, 남는 횟수는 1번 계단에서 지팡이를 두드려 소모 가능
-> 최소 도달 횟수 <= K이면 minigimbob 출력
⏳ 회고
1번 계단에서 지팡이가 제자리라는 점을 파악하면 단순히 최소 횟수만 비교하면 됨
ez