Skip to content

Latest commit

 

History

History
11 lines (7 loc) · 158 Bytes

계단.md

File metadata and controls

11 lines (7 loc) · 158 Bytes

n,k = 40,20

fibo = [1]

for i in range(1,k): fibo.append(1+sum(fibo[:i]))

for i in range(k+1,n+1): fibo.append(sum(fibo[i-k-1:i]))

print(fibo[n-1])