Skip to content

Commit 3cc4487

Browse files
committed
[BOJ] #9461. 파도반 수열 / 실버3 / 14분 (성공)
1 parent 90b990c commit 3cc4487

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import sys
2+
input = sys.stdin.readline
3+
4+
t = int(input()) #테스트케이스의 수
5+
dp = [1] * 101
6+
for __ in range(t): # 테스트케이스 수만큼 반복
7+
p_n = int(input()) # 테스트케이스 입력
8+
for i in range(4, p_n+1): #4부터 시작
9+
dp[i] = dp[i-3] + dp[i-2] # 점화식
10+
print(dp[p_n])
11+

0 commit comments

Comments
 (0)