Skip to content

Commit 37cbaba

Browse files
committed
[BOJ] 타일 장식물 / 실버5 / 10분
https://www.acmicpc.net/problem/13301
1 parent 123ae69 commit 37cbaba

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
n = int(input())
2+
3+
dp = [1, 1, 2, 3, 5, 8]
4+
5+
if n > 5:
6+
for i in range(6, n):
7+
dp.append(dp[i-1] + dp[i-2])
8+
9+
ans = (dp[n-1] * 2) + ((dp[n-1] + dp[n-2]) * 2)
10+
11+
if n == 1:
12+
ans = 4
13+
14+
print(ans)

0 commit comments

Comments
 (0)