[Baekjoon-14501] 타임어택 문제풀이 #163
Open
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이 최대 15로 크지 않기에 dp라 하긴 좀 부끄러운.. 브루트포스에 가까운 풀이방법 입니다.
현재 날짜도 포함하여 세는 것 때문에 풀 때 헷갈렸네요.
dp[i] 를 dp[1] 부터 dp[i - 1]에서 각 상담 가능한 날짜가 있다면 더해보고 최대값을 비교해서 d[i]에 반영합니다.
선우가 푼 뒤에서부터 본다는 방법을 그땐 깨닫지 못했는데, d[i]를 i날부터 퇴사일까지 최대 금액으로 설정하면 O(N)으로 해결할 수 있을 것 같습니다.