Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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/25189
🧭 풀이 시간
50분
👀 체감 난이도
✏️ 문제 설명
개구리가 격자 칸 안의 먹이를 먹는다. 그 먹이만큼 점프를 할 수 있는데 딱 1번 먹이를 무시하고 점프를 할 수 있다. 개구리가 집에 가기 위한 최소 점프 횟수를 구하라.
🔍 풀이 방법
visited[x][y][z]: x, y칸에 z(0: 무시점프 안함, 1: 무시점프 함)했을 때의 점프 횟수로 처리했다.
중요한 건 해당 행 혹은 열에서 무시점프를 했다면 다시 해당 행, 열에선 무시점프를 하면 안된다는 것이다. 이를 처리하지 않으면 시간초과가 발생했다.
⏳ 회고
오랜만에 생각해야 할 bfs문제라서 재밌었다.