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/11047
✔️ 소요된 시간
약 40분
✨ 수도 코드
🪙1. 문제 설명🪙
동전의 종류와 목표 금액이 주어졌을 때, 최소한의 동전 개수로 목표 금액을 만드는 방법 찾기
🪙2. 문제 풀이 방법🪙
1) 입력 처리
2) 정렬
3) 그리디 선택
4) 종료 조건
5) 결과 출력
🪙3. 알고리즘🪙
🪙4. 최종 코드🪙
📚 새롭게 알게된 내용
그리디 알고리즘이 매 단계에서 최적의 선택을 하는 것은 알고 있었지만, 동전 문제에서 큰 동전부터 사용하는 것이 최적이라는 점을 이해하기 좀 힘들었던 것 같다. 또한 이 문제가 "동전의 가치가 서로 배수 관계일 경우" 였기 때문에 그리디 알고리즘이 최적의 해를 보장하는 것이라는 것을 알게되었다.
그리디 알고리즘이 문제에 어떻게 적용되는지 알게되었으며, 그리디 알고리즘이 일반적으로 시간복잡도가 낮아 빠르게 처리할 수 있다는 것을 알게되었다.
추가적으로, 동전의 가치가 서로 배수 관계가 아닐 경우, 그리디 알고리즘이 아닌 '동적 프로그래밍'을 사용해야 한다는 것을 알게되었다.