쏘ing
[Python] 백준 11726 2 x n 타일링 본문
https://www.acmicpc.net/problem/11726

풀이
num = int(input())
num_list = [0, 1, 2, 3]
if num < 3:
print(num_list[num] % 10007)
else:
# f(n) = f(n-1) + f(n-2)
for i in range (4, num+1):
num_list.append(num_list[-1] + num_list[-2])
print(num_list[num] % 10007)
'알고리즘 > CLASS 3' 카테고리의 다른 글
[Python] 백준 2606 바이러스 (0) | 2022.02.26 |
---|---|
[Python] 백준 1260 DFS와 BFS (0) | 2022.02.26 |
[Python] 백준 11286 절댓값 힙 (0) | 2022.02.23 |
[Python] 백준 1927 최소 힙 (0) | 2022.02.22 |
[Python] 백준 9461 파도반 수열 (0) | 2022.02.21 |
Comments