diff --git "a/seongwon030/DP/1,2,3 \353\215\224\355\225\230\352\270\2603.py" "b/seongwon030/DP/1,2,3 \353\215\224\355\225\230\352\270\2603.py" new file mode 100644 index 0000000..a891a28 --- /dev/null +++ "b/seongwon030/DP/1,2,3 \353\215\224\355\225\230\352\270\2603.py" @@ -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]) \ No newline at end of file