[20250807] BOJ / P4 / 퀴즈쇼 / 권혁준 #622
Merged
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/1462
🧭 풀이 시간
20분
👀 체감 난이도
✏️ 문제 설명
N개의 문제가 주어진다. 각 문제의 점수는 a[i], 보너스 점수는 b[i]이다.
순서대로 문제를 풀어야 한다.
정답을 맞추면 코인 1개와 그 문제에 해당하는 점수를 받고, 맞추지 못하면 지금까지 가지고 있던 코인을 모두 빼앗기고 그 문제에 해당하는 점수를 감점받는다.
코인을 M개 모은다면, 그 문제에 해당하는 보너스 점수를 얻고 코인을 모두 반납한다.
문제를 자유롭게 맞고 틀릴 수 있다면 최대 몇 점까지 받을 수 있는지 구해보자.
🔍 풀이 방법
DP를 세 개 정의한다.
이렇게 하면 깔끔하게 식이 나온다.
⏳ 회고
이거왜플래임