[20260226] BOJ / G3 / 소문난 칠공주 / 김민진#1974
Merged
ShinHeeEul merged 1 commit intomainfrom Feb 26, 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.
🧷 문제 링크
소문난 칠공주
🧭 풀이 시간
60분
👀 체감 난이도
✏️ 문제 설명
자리 배치가 주어짐
상하좌우 인접한 7개의 좌석을 고를 때,
S가 포함된 자석이 4개 이상인 경우의 수는?🔍 풀이 방법
mask조합 탐색visited조합 중복 선택 방지조합은 0부터 24까지로 만들고
num / 5,num % 5해서 좌표값 구하기재귀 돌면서 조합을 하나씩 선택 - 인접한 칸만 확인
visited로 탐색한 조합인지 아닌지 확인조건에 맞으면
+1⏳ 회고
처음엔 조합 다 구하고 그걸로 bfs 돌렸는데 시간이 좀 오래걸림
비트마스킹이 시간 줄이는 데 진짜 최고긴 하다..