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.
π λ¬Έμ λ§ν¬
μ±λ₯κ°λΉ
βοΈ μμλ μκ°
2μκ°
β¨ μλ μ½λ
μ²μμ 그리λλ‘ μ κ·Όνλ€.
λΉμ°ν μ΅λ μλ₯Ό μΆλ ₯ν λμλ μ±λ₯κ°λΉ μκ° κ°μ₯ μ κ²λλ
1
λ‘ μλ¦Ώμλ₯Ό λ리λκ² μ΄λμ΄λ,νμκ°μ μ±λ₯κ°λΉμΌ λμλ 3κ°λ‘ λ§λ€ μ μλ
7
μ νλ λ§λ€κ³ λ¨μ μ§μκ°μ μ±λ₯ κ°λΉλ λͺ¨λ1
μ λΆμ¬μ€λ€.ν° μλ₯Ό λ§λλ κ²μ μμ² μ½λ€.
κ·Όλ°... κ°μ₯ μμ μλ μ΄λ»κ² λ§λ€ κ²μΈκ° ...?
λ¨μ§ μλ¦Ώμλ§ μ€μ΄λ©΄ λλ κ²μ΄ μλλ€.
μ±λ₯κ°λΉ κ°―μκ° 8μ΄λ©΄, 19λ κ°λ₯νκ³ 91λ κ°λ₯νλ©°,
10λ κ°λ₯νκ³ 16λ κ°λ₯νκ³ 61λ κ°λ₯νλ€.
27, 72λ κ°λ₯νκ³ λ±λ±...
μλ¦Ώμλ₯Ό λμ΄μ κ°μ μλ¦Ώμ λ΄λΆμμλ μλνλ λ‘μ§μ λ§λ€μ΄μΌ νλ€.
μ΄λ»κ² μ΄λ»κ² μ£Όμ΄μ§ 보기μμλ§ μλνλ μλ λ‘μ§μ λ§λ€μ΄μ μ μΆνμκ³ ,
κ·Έ κ²°κ³Όλ λΉμ°ν μ€ν¨μλ€.
λμ ν μ΄ν΄κ° κ°μ§μμμ κ²μλ¬Όμ λ€μ Έ λ°λ‘λ₯Ό μ°Ύμλ€.
input : 1 78
output : 108888888888 111111111111111111111111111111111111111
νμ§λ§ λ΄ μ½λλ
output : 10000000000004 111111111111111111111111111111111111111
μ λ±μΌλ©° μ μ¬νμλ€.ν 40λΆ μ‘κ³ μλ€κ° λμ ν λͺ¨λ₯΄κ² μ΄μ μκ³ λ¦¬μ¦ λΆλ₯λ₯Ό νμΈνμλ€.
...!!
" λ€μ΄λλ―Ή νλ‘κ·Έλλ° "
μ΄μνκ² μ ν€μλλ₯Ό 보μλ§μ κ³λ¨ μ κ° λ μ¬λκ³ ,
DPν μ΄λΈμ μΈλ±μ€λ₯Ό μ¬μ©ν μ±λ₯κ°λΉ κ°μλ‘ μ‘κ³ ,
οΏ½νμ¬ μΈλ±μ€μμ nκ°λ₯Ό λ μ¬μ©νμ¬ λ§λ€ μ μλ μ΅λ κ°κ³Ό μ΅μ κ°μ κ°±μ νλ©° λμμ€λ€.
λ§μ΄ λκ² μ΄λ €μ΄λ°,
μ κ°μ λ°©μμΌλ‘ λ§μ΄λ€.
μ§λ¬Έκ³Ό λ¬Έμ κ° κ°λ¨νκ³ ν¨μ μΌλ‘ λΉ μ§κΈ° μ¬μ΄ λ¬Έμ μΈ κ² κ°λ€.
DPλ₯Ό μ λ μ¬λ¦¬μ§ λͺ»νμκΉ...? κ³λ¨ μμ λΉμ·νλ° λ§μ΄λ€.
π μλ‘κ² μκ²λ λ΄μ©