반응형
ㅁㅁㅁㅁㄴㅁㄴㅇㅁㄴㅇㅁㄴㅇㅁㄴㅇ
ㅁㄴㅇ
ㅁㄴㅇ
ㄴㅁㅇ
memList = [None]*100 def fibonacci(n): if n <=1 : return n if memList[n] is not None: return memList[n] memList[n] = fibonacci(n-1) + fibonacci(n-2) return memList[n] print fibonacci(10)
반응형
ㅁㅁㅁㅁㄴㅁㄴㅇㅁㄴㅇㅁㄴㅇㅁㄴㅇ
ㅁㄴㅇ
ㅁㄴㅇ
ㄴㅁㅇ
memList = [None]*100 def fibonacci(n): if n <=1 : return n if memList[n] is not None: return memList[n] memList[n] = fibonacci(n-1) + fibonacci(n-2) return memList[n] print fibonacci(10)
댓글