Skip to content

Commit 4433595

Browse files
committed
[BOJ] #9095. 1,2,3 더하기 / 실버3 / 20분(성공)
1 parent 7a4fd2e commit 4433595

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import sys
2+
input = sys.stdin.readline
3+
dp = [1] * 12
4+
dp[2] = 2
5+
t = int(input())
6+
for _ in range(t):
7+
n = int(input())
8+
for i in range(3, n+1):
9+
dp[i] = dp[i-1] + dp[i-2] + dp[i-3]
10+
print(dp[n])

0 commit comments

Comments
 (0)