https://www.acmicpc.net/problem/2193
# 2023.01.29
import sys
input = sys.stdin.readline
n = int(input())
dp = [[0]*(2) for _ in range(n)]
dp[0][0], dp[0][1]= 0, 1
for i in range(1, n):
for j in range(2):
if j==0:
dp[i][j]=dp[i-1][0]+dp[i-1][1]
else:
dp[i][j]=dp[i-1][0]
print(dp[n-1][0]+dp[n-1][1])
'Problem Solving > BOJ' 카테고리의 다른 글
[DP] python 1309 동물원 (0) | 2023.02.03 |
---|---|
[DP] python 12852 1로 만들기2 (0) | 2023.02.01 |
[DP] python 1890 점프 (0) | 2023.01.29 |
[DP] python 11048 이동하기 (0) | 2023.01.29 |
[DP] python 2294 동전2 (0) | 2023.01.29 |