Skip to content

Commit

Permalink
Merge pull request #38 from AlgoLeadMe/9-seongwon
Browse files Browse the repository at this point in the history
9-seongwon
  • Loading branch information
seongwon030 authored May 13, 2024
2 parents 5a2a9e6 + a5c3f7e commit de75008
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions seongwon030/DP/1,2,3 ๋”ํ•˜๊ธฐ3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import sys

input = sys.stdin.readline
dp = [1,2,4,7]
p = 4
for i in range(int(input())):
n = int(input())
while(n>p):
dp.append((dp[p-3]+dp[p-2]+dp[p-1])%1000000009)
p+=1
print(dp[n-1])

0 comments on commit de75008

Please sign in to comment.