[20250312] BOJ / G1 / 구슬 탈출 2 / 김수연 #235
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/13460
🧭 풀이 시간
60분
👀 체감 난이도
✏️ 문제 설명
보드를 움직여서 빨간 구슬과 파란 구슬을 움직인다.
빨간 구슬이 구멍에 빠지되, 파란 구슬은 빠지지 않도록 움직인 최소 횟수 구하기
🔍 풀이 방법
이전에 가로로 움직였으면 다음은 세로로 움직이도록 설정하고, 세로였으면 가로로 움직이도록 설정했다.
R -> B -> R 이렇게 3번 움직이도록 만들면서 빨간 구슬이 파란 구슬에 막혀서 움직이지 못한 상황을 처리했다.
⏳ 회고
예외 처리만 제대로 하면 구현은 쉬운거 같다.