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.
🧷 문제 링크
https://www.acmicpc.net/problem/1006
🧭 풀이 시간
60분
👀 체감 난이도
✏️ 문제 설명
두 개의 원 모양으로 건물이 존재하고, 각 원에는 N개의 구역이 존재한다.
각 구역에는 적들이 존재해서, 특수소대를 침투시켜 모든 구역을 소탕하려 한다.
특수소대원의 수는 W이고, 한 특수소대는 한 구역 혹은 인접한 두 구역에 침투할 수 있다.
침투시켜야 할 특수 소대의 최소 개수를 구해보자.
🔍 풀이 방법
조건이 있는 2N 타일링 문제로 바꿔서 생각해봤다.
사용할 수 있는 타일은 11 혹은 12이고, 12는 합이 W 이하인 경우만 사용할 수 있도록 가정했다.
N * 3 크기로 DP를 설계했다.
dp[n][0] = n번 열까지 고려. 1행만 채워짐
dp[n][1] = n번 열까지 고려. 2행만 채워짐
dp[n][2] = n번 열까지 고려. 모두 채워진 경우
근데 이 문제는 원형이라서 맨 끝 원소를 하나씩 땡겨와서 여러번 DP를 돌리고, 그 중 최솟값을 구해줬다.
⏳ 회고
너무복잡함