[BOJ] 11727. 2xn ํ์ผ๋ง 2(python)
๐๋ฌธ์
๐ช์์ด๋์ด
๐ฅ์ฝ๋
1
2
3
4
5
6
7
8
import sys
input = sys.stdin.readline
n = int(input())
dp = [0,1,3]
for _ in range(3,n+1):
dp.append(dp[-1]+2*dp[-2])
print(dp[n]%10007)
This post is licensed under CC BY 4.0 by the author.
Comments powered by Disqus.