[20251125] BOJ / G3 / 색상환 / 설진영 #1512
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/2482
🧭 풀이 시간
1시간
👀 체감 난이도
✏️ 문제 설명
N개의 색이 원형으로 배열된 색상환에서 인접하지 않은 K개의 색을 선택하는 경우의 수를 구하는 문제
🔍 풀이 방법
dp[i][j] = i개 중 인접하지 않게 j개 선택
dp[i][j] = dp[i-1][j] + dp[i-2][j-1]
i번째 안 선택 + i번째 선택(i-1은 불가)
⏳ 회고
원형 배열을 두 케이스로 분리해야함
왤케어렵지