ν°μ€ν 리 λ·°
λ°±μ€ 9095λ²μ 1, 2, 3 λνκΈ° λ¬Έμ μ λλ€
μ μΆλ ₯μ μ΄λ¬ν©λλ€
μ°μ
4λ₯Ό 1κ³Ό 2μ 3μΌλ‘ νννλ λ°©λ²μ 7κ°μ§μ λλ€.
μ¬κΈ°μ
5λ₯Ό νννλ λ°©λ²μΌλ‘λ
4μμ 1μ λνλλ°©λ² (7κ°μ§)
3μμ 2λ₯Ό λνλ λ°©λ²
2μμ 3μ λνλ λ°©λ²μ΄ μμ΅λλ€.
6μ νννλ λ°©λ²μ λμΌνκ²
5μμ 1μ λνλ λ°©λ²
4μμ 2λ₯Ό λνλ λ°©λ²
3μμ 3μ λνλ λ°©λ²μ΄ μκ² μ΅λλ€.
κ·Έλμ Nμ νννλ λ°©λ²μΌλ‘λ
array[N] = array[N-1] + array[N-2] + array[N-3]
μ΄λΌκ³ ν μ μκ² μ΅λλ€
νμ΄μ¬μΌλ‘ μμ±ν μ½λλ μ΄λ μ΅λλ€.
import sys
n = int(input())
arr = [0] * 11
arr[1] = 1
arr[2] = 2
arr[3] = 4
for i in range(4,11):
arr[i] = arr[i-1] + arr[i-2] + arr[i-3]
for i in range(0,n):
testNum = int(input())
print(arr[testNum])
μ λμνλ λͺ¨μ΅
κ°μ¬ν©λλ€.
λκΈ
곡μ§μ¬ν
μ΅κ·Όμ μ¬λΌμ¨ κΈ
μ΅κ·Όμ λ¬λ¦° λκΈ
- Total
- Today
- Yesterday
λ§ν¬
TAG
- swift urlcomponent encode
- swift μμ μ½κΈ°
- chatgpt rag llm
- swift network module
- google timer μ΄ν
- deep timer
- swift urlsession 곡ν΅ν
- rag κΈ°λ° llm
- rag κΈ°λ° llm μ±λ΄
- google timer application
- llm csv
- swift μμ κ°μ Έμ€κΈ°
- νμ΄λ¨Έ μ΄ν
- swift filemanager get excel
- swift excel read
- rag llm pdf
- focus timer μ΄ν
- swift λ€νΈμν¬ λͺ¨λν
- llm pdf rag
- filemanager excel read
- swift queryitem encode
- swift urlsession refactoring
- swift μκ°
- swift network refactoring
- swift get excel
- swift urlsession network module
- κ΅¬κΈ νμ΄λ¨Έ μ΄ν
- swift filemanager excel
- swift urlsession module
- swift network 곡ν΅ν
μΌ | μ | ν | μ | λͺ© | κΈ | ν |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
κΈ λ³΄κ΄ν¨