[20250826] BOJ / G1 / 동전 뒤집기 / 김민진 #746
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.
🧷 문제 링크
동전 뒤집기
🧭 풀이 시간
120분
👀 체감 난이도
✏️ 문제 설명
동전 뒷면이 가장 적게 나오도록 뒤집었을 때, 뒷면인 동전의 수 구하기
🔍 풀이 방법
비트마스킹으로 풀었습니다.
coins의 인덱스가 하나의 행을 의미하고, 비트 마스킹을 사용해서 뒤집히는 경우의 수를 계산했습니다.처음에는 행과 열을 모두 일일이 고려하는 코드를 작성했는데, 시간이 너무 오래 걸려서 보니까 다른 사람들은 열만 고려하더라고요~..
코드에 주석이랑 변수 좀 잘못 적힌 게 많은데 그건 무시하시고,,....,.
열은 완탐하고 행은 그리디로 찾는 방법입니다.. 어려워
⏳ 회고
🙂🙃🙂🙃