From c9c942ea933a3b4c9b6cc7b427ba920977b0aef6 Mon Sep 17 00:00:00 2001 From: sunyeongchoi Date: Fri, 22 Jan 2021 14:11:56 +0900 Subject: [PATCH] =?UTF-8?q?1=EC=9B=94=2022=EC=9D=BC=20=EC=95=8C=EA=B3=A0?= =?UTF-8?q?=EB=A6=AC=EC=A6=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- argorithm/123add_dp_practice.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 argorithm/123add_dp_practice.py diff --git a/argorithm/123add_dp_practice.py b/argorithm/123add_dp_practice.py new file mode 100644 index 0000000..001737d --- /dev/null +++ b/argorithm/123add_dp_practice.py @@ -0,0 +1,10 @@ +import sys + +T = int(sys.stdin.readline()) + +dq = [0, 1, 2, 4] +for _ in range(T): + n = int(sys.stdin.readline()) + for i in range(len(dq), n+1): + dq.append(dq[i-1]+dq[i-2]+dq[i-3]) + print(dq[n]) \ No newline at end of file