ν°μ€ν 리 λ·°
λ°±μ€ 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 git ignore
- llm rag
- rag μ±λ΄
- μλμννΈ λ μ΄μΈμ΄
- swift filemanager excel
- llm pdf rag
- κ³΅λΆ νμ΄λ¨Έ μ΄ν
- ios gitignore
- λΉλκΈ° 리μ€νΈ swift
- swift excel read
- llm csv
- swift μμ κ°μ Έμ€κΈ°
- λ λμΈμ΄ μ΄ν
- rag μμ±ν ai
- filemanager excel read
- ragκΈ°λ° ai
- λΉλκΈ° νμ΄μ§ swift
- rag llm pdf
- readysay
- concurrency pagination
- swift get excel
- chatgpt rag llm
- swift filemanager get excel
- rag κΈ°λ° llm
- swift μμ μ½κΈ°
- rag ai
- ragκΈ°λ° μ±λ΄
- λ λμΈμ΄
- swift μκ°
- rag μμ
| μΌ | μ | ν | μ | λͺ© | κΈ | ν |
|---|---|---|---|---|---|---|
| 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 |
κΈ λ³΄κ΄ν¨