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.
📖 풀이한 문제
💡 문제에서 사용된 알고리즘
📜 코드 설명
테이블 정의
n일까지의 최대 수익이 들어갈 배열 정의
profit_max[N + 1]
초기값 세팅
T[]와 P[]에 입력에 주어진 상담 기간과 금액을 넣어준다.
점화식 세우기
주석 참고
꼭 (i + T[i])일만 상담 할 수 있는 것은 아니고, 상담 다음날 상담을 할 수도 있는 것이다.
퇴사날 받을 수익: profit_max[N]
close #67