Skip to content

Conversation

@Seol-JY
Copy link
Contributor

@Seol-JY Seol-JY commented Jul 5, 2025

🧷 문제 링크

https://www.acmicpc.net/problem/1106

🧭 풀이 시간

40분

👀 체감 난이도

✏️ 문제 설명

호텔 사장이 홍보를 통해 최소 C명의 고객을 늘리려고 함.
각 도시마다 홍보 비용과 증가하는 고객 수가 주어지고, 각 도시에서 무제한으로 홍보 가능(정수배만).
목표 고객 수 이상을 달성하는 최소 비용을 구하는 문제.

🔍 풀이 방법

Unbounded Knapsack Problem(무한 배낭 문제)

dp[i] = 정확히 i명의 고객을 얻는 최소 비용
각 도시에 대해 무제한으로 선택 가능하므로 내부 반복문에서 앞에서부터 업데이트
목표보다 많은 고객을 얻을 수 있으므로 배열 크기를 C + 101로 설정
최종적으로 dp[C]부터 dp[C+100] 중 최솟값이 답
dp[j] = min(dp[j], dp[j - customer[i]] + cost[i])

⏳ 회고

목표 고객 수를 "이상"으로 해석하는 부분에서 배열 크기 설정 중요

@Seol-JY Seol-JY added the success 👍 해설을 보지 않고 풀었을 때 label Jul 5, 2025
@ShinHeeEul ShinHeeEul merged commit 64c4804 into main Jul 5, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

success 👍 해설을 보지 않고 풀었을 때

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants