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/11985
🧭 풀이 시간
30분
👀 체감 난이도
✏️ 문제 설명
박스 비용 + 박스 내 오렌지 개수*(박스 내 오렌지 최대 크기 - 박스 내 오렌지 최소 크기) 공식이 주어지고, 박스에 담을 수 있는 오오렌지의 최대 개수가 주어질 때, 오렌지 포장 비용 최솟값 구하기
🔍 풀이 방법
DP로 푼다. 박스에 담을 수 있는 오렌지의 최대 개수만큼 반복을 돌리고, 바로 그 이전에 최소 비용을 더하는 방식으로 1차원 DP 배열을 만들어 마지막 값을 출력하면 된다.
⏳ 회고
DP는 점화식만 세울 수 있으면 쉬운듯(<<< 이게 제일 어려움)
반복 시작 전 초기값 결정이 어려웠는데, 배열 시작 지점 앞에 빈 칸이 있으면 코드가 훨씬 간결해진다.