[20251024] BOJ / G1 / 수영장 만들기 / 이준희 #1213
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/1113
🧭 풀이 시간
60분
👀 체감 난이도
✏️ 문제 설명
1~9로 표현되는 벽이 있고 벽으로 둘러싼곳에 물을 담아 수영장을 만들 수 있을 때
수영장에 물을 얼마만큼 넣을 수 있는지 구하는 문제입니다.
🔍 풀이 방법
흙은 물을 무한대로 흡수하기 때문에 N+2, M+2 배열을 만들어 주어지는 수(벽)을 0으로 감싼 배열을 생성했습니다.
그리고 벽의 높이가 2인것부터 계산하여 그보다 작은 경우의 범위를 찾아 높이 - 높이로 각 단계별로 BFS를 진행했습니다.
설명이 잘 안되니 코드를 보기 바랍니다.
⏳ 회고
중간에 0을 만나는 경우에 바로 return 했었는데 그 곳으로 안가면 되는 경우를 간과했던 것 같습니다.