[20251120] BOJ / G4 / 물통 / 김민진 #1461
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.
🧷 문제 링크
물통
🧭 풀이 시간
50분
👀 체감 난이도
✏️ 문제 설명
물통 3개가 있음(A, B, C)
물통에 있는 물은 옮겨담을 수 있고 다른 통에 꽉 채우거나 물병을 비우거나 둘 중 하나 가능
A 물통이 비어있을 때 C 물통에 담을 수 있는 물의 양을 오름차순으로 출력
🔍 풀이 방법
물통은 3개로 고정이니까 물을 옮겨 담을 수 있는 방법은 6가지
6가지 중에서도 물을 전부 옮겨 담을 수 있는지 없는지 추가적으로 고려해주면 됨
물 양은 고정이라 방문 처리 배열 3차원까지는 의미 없는듯?
물 양은 중복 불가 + 오름차순이라 TreeSet에다 저장함
⏳ 회고
걍 노가다인데 밤샘 이슈로 머리 안굴러가서 미치는줄
근데 왜 bfs지 dfs가 더 쉽지 않나
아무튼 이제 잘거임