피보나치(2)
-
BAEKJOON #1003 피보나치 함수
이 문제의 저작권은 BAEKJOON에 있습니다. https://www.acmicpc.net/problem/1003 문제는 위 링크에서 확인할 수 있습니다. test_case = int(input()) zero = [1, 0, 1] one = [0, 1, 1] for _ in range(test_case): num = int(input()) zreo_len = len(zero) if zreo_len
2020.07.09 -
(스택) 종이붙이기
이 문제의 저작권은 SW Expert 아카데미에 있습니다. https://swexpertacademy.com/main/learn/course/subjectDetail.do?courseId=AVuPDN86AAXw5UW6&subjectId=AWOVHzyqqe8DFAWg 문제는 위 링크에서 확인할 수 있습니다. def f(n): #점화식을 잘 세울 필요가 있다. #마지막 경우만 따져본다. #20*20 종이가 하나 #20*10 종이가 하나 #10*20 종이 둘 if n < 2: return 1 return f( n-1 ) + 2 * f( n-2 ) for t in range(int(input())): N = int(input()) // 10 print(f"#{t+1} {f(N)}") 가로 30인 종이를 만든다고..
2020.02.19