lru_cache1 백준 10826 피보나치 수 4 1 2 3 4 5 6 7 8 from functools import lru_cache @lru_cache() def nth_fibo(n): if n==0: return 0 elif n==1 or n==2 : return 1 else : return nth_fibo(n-1)+nth_fibo(n-2) print(nth_fibo(int(input()))) cs 1 2 3 4 5 6 7 8 9 from functools import lru_cache import sys sys.setrecursionlimit(10**6) @lru_cache() def nth_fibo(n): if n==0: return 0 elif n==1 or n==2 : return 1 else : return nth_fibo(n-1)+nth.. 2021. 12. 22. 이전 1 다음