[20260228] BOJ / G5 / 계란으로 계란치기 / 김민진#1980
Merged
ShinHeeEul merged 1 commit intomainfrom Feb 28, 2026
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.
🧷 문제 링크
계란으로 계란치기
🧭 풀이 시간
30분
👀 체감 난이도
✏️ 문제 설명
계란끼리 부딪혀서 계란을 깨려고 함
내구도와 무게가 주어지는데 내구도는 부딪힌 다른 계란의 무게만큼 줄어듦 - 두 개가 동시에 깨질 수도 있음
가장 왼쪽의 계란부터 들어서 깨기 시작
한 번 치면 내려놓고 그 오른쪽 거 들어서 치기, 칠 계란 없으면 오른쪽 계란으로 계속 옮기기... 를 N번 진행해서 가장 많이 깰 수 있는 계란의 수는?
🔍 풀이 방법
백트래킹 완탐
사실 대놓고
N <= 8이라...depth랑 깨진 현 시점 계란 갯수 변수 전달해서 계란 깨기지금 들고 있는 계란이 이미 깨졌으면 패스, 아니면 반복문 돌면서 계란 깨기
만약 반복문 다 돌았는데 깰 개란 없으면 다음 사이클로 넘기기
⏳ 회고
문제가 거진 깜지임
딱히 영양가는 없는 것이 딱 수능 영어 지문 st
졸려서 읽느라 혼났네요