[20250629] BOJ / G4 / 물통 / 김수연 #398
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/2251
🧭 풀이 시간
40분
👀 체감 난이도
✏️ 문제 설명
A, B, C리터 물통 3개가 있고, C는 가득 차 있음
물을 다른 물통으로 부을 수 있을 때, A 물통이 비어있을 때, C 물통에 담겨있을 수 있는 물의 양 구하기
🔍 풀이 방법
dfs 사용
3차원 배열로 각각의 방문 여부 전부 확인
⏳ 회고
3차원 배열 오랜만이다..
TreeSet 사용하면 set이면서 정렬도 같이 시킬 수 있음!