[20251017] BOJ / G4 / 리모컨 / 김민진 #1151
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.
🧷 문제 링크
리모컨
🧭 풀이 시간
40분
👀 체감 난이도
✏️ 문제 설명
숫자 버튼이 고장난 리모컨이 있음.
목표로 하는 채널로 이동하는데 버튼을 눌러야하는 횟수의 최솟값.
현재 채널은 100
🔍 풀이 방법
현재 채널이 100이라
+,-버튼으로만 움직였을 때의 수로ans초기화이후 순열 사용해서 완탐
고장난 버튼이 하나라도 있으면 패스
전부 누를 수 있으면 그 횟수에
abs(목표 채널 - 확인 중인 수)한 값(±1)을 더해줌M == 0예외 처리 필요⏳ 회고
심란한 하루입니다..^_^