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.
π λ¬Έμ λ§ν¬
[BOJ] κ³λ¨ μ€λ₯΄κΈ° https://www.acmicpc.net/problem/2579
βοΈ μμλ μκ°
30min
β¨ μλ μ½λ
μ νμμ
(3κ³λ¨ μ°μμΌλ‘ λ°μ μ μλ μ‘°κ±΄μ΄ μμΌλ―λ‘,
μ΄μ κ³λ¨μ λ°κ³ μ¨ κ²½μ°μ κ·Έλ μ§ μμ κ²½μ°λ‘ λλμ΄μ
maxκ°μ ꡬνκ³ νμ¬ κ³λ¨μ μ μλ₯Ό λν©λλ€.)
dp[i-3] + scores[i-1]μ΄ μ΄μ κ³λ¨μ λ°κ³ μ¨ κ²½μ° μ λλ€.
dp[i-1]μ΄ μλ μ΄μ λ dp[i-1]λ κ²½μ°κ° λκ°μ§ μκΈ° λλ¬Έμ λλ€.
π μλ‘κ² μκ²λ λ΄μ©
μ΅κ·Ό μ¬λ¬λΆμ΄ dp λ¬Έμ λ₯Ό λ§μ΄ μ¬λ €μ£Όμ μ λ§μ΄ νμ΄λ΄€λλ°μ.
κ·ΈλΌμλ 15λΆ μ λ νΌμ μκ°ν΄λ΄λ μ νμμ λ μ¬λ¦¬μ§ λͺ»νμ΅λλ€.
κ·Έλλ μ΄λ² λ¬Έμ λ₯Ό νλ©΄μ μ΄λ μ λ κ°μ΄ μ‘°κΈμ© μ‘νκ°λ κ² κ°μ΅λλ€.