Skip to content

Commit

Permalink
바닥 공사 (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
ezidayzi committed Mar 6, 2022
1 parent f1296b4 commit fe71614
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import sys
n = int(sys.stdin.readline().rstrip())

d = [0] * (n+1)

d[1] = 1
d[2] = 3

for x in range(3, n+1):
d[n] = d[n-1] + d[n-2] * 2

print(d[n])

0 comments on commit fe71614

Please sign in to comment.