11726

https://www.acmicpc.net/problem/11726규칙을 먼저 찾아보자본인은 A4용지에 그려가며 규칙을 찾아보았다.즉, 전에 풀었던 내용과 같은 방식이다.https://koreatstm.tistory.com/148 [백준/Python] 2748:피보나치 수 2https://www.acmicpc.net/problem/2748n=int(input())def func(n): if n==0: return 0 if n==1: return 1 else: return func(n-1)+func(n-2)print(func(n))시간초과가 난다.캐싱을 안해서 오래걸리고, 시간복잡도도 엄청 높기에 시간초과가koreatstm.tistory.com이처럼 f(n) = f(n-1) + f(n-2)의 규칙이다.이제..
계란소년
'11726' 태그의 글 목록