15988

suhan cho·2022년 7월 11일
0
def plus(count):
    dp = [0 for i in range(1000001)]
    dp[0]=0
    dp[1]=1
    dp[2]=2
    dp[3]=4
        
    

    for x in range(4,1000001):
        dp[x]=(dp[x-3]+dp[x-2]+dp[x-1])%1000000009

    for i in range(0, count):
        print(dp[int(input())])

plus(int(input()))
profile
안녕하세요

0개의 댓글