10009를 나누라고 본문에 나옴
a = int(input())
fibo = [0] * 201
def fib(n):
if n < 2:
return n
if fibo[n] == 0:
fibo[n] = (fib(n - 1) + fib(n - 2)) % 10009
# print("n=",n,"fibo[n]=",fibo[n])
return fibo[n]
print(fib(a))
================================================>
구글링하다보니
fib={1:1,2:1}
def f(x) :
if x in fib:
return fib[x]
fib[x]=(f(x-1)+f(x-2))%10009
return fib[x]
n=int(input())
print(f(n))
로 하면 깔끔하게 끝남