[BOJ 2294] 동전 2 - #261
Merged
Merged
[BOJ 2294] 동전 2#261
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.
풀이 요약
dp[x]를 x원을 만드는 데 필요한 최소 동전 개수로 정의하고, 각 동전을 마지막에 사용하는 경우를 비교하는 메모이제이션 DP를 적용합니다.K + 1로 두어 최소값 계산 후 K원에 도달할 수 없는 경우-1을 출력합니다.O(NK), 공간 복잡도는O(K)입니다.Link
https://velog.io/@sh0723/PS-%EB%B0%B1%EC%A4%80-2294%EB%B2%88-%EB%8F%99%EC%A0%84-2
문제
Closes #260