From a5c3f7e19528d73e771cbee589153234a2df7bf0 Mon Sep 17 00:00:00 2001 From: seongwon030 <105052068+seongwon030@users.noreply.github.com> Date: Mon, 29 Apr 2024 17:29:22 +0900 Subject: [PATCH] =?UTF-8?q?2024-4-29=201,2,3=20=EB=8D=94=ED=95=98=EA=B8=B0?= =?UTF-8?q?3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../1,2,3 \353\215\224\355\225\230\352\270\2603.py" | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 "seongwon030/DP/1,2,3 \353\215\224\355\225\230\352\270\2603.py" 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