728x90
반응형

기본적인 다이나믹 프로그래밍 문제이다.

n = int(input())
a, b = 1, 0
for i in range(n):
    a, b = (a+b)%10, a%10
print(a)
728x90
반응형

+ Recent posts