Skip to content

Commit

Permalink
1월 22일 알고리즘
Browse files Browse the repository at this point in the history
  • Loading branch information
sunyeongchoi committed Jan 22, 2021
1 parent a8cd1c1 commit c9c942e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions argorithm/123add_dp_practice.py
Original file line number Diff line number Diff line change
@@ -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])

0 comments on commit c9c942e

Please sign in to comment.