[白俊]9095
3720 ワード
質問する
https://www.acmicpc.net/problem/9095


に答える
# bottom-up
import sys
t = int(sys.stdin.readline().rstrip())
for i in range(t):
n = int(sys.stdin.readline().rstrip())
d = [0] * 11
d[0] = 1
d[1] = 1
d[2] = 2
for j in range(3, n+1):
d[j] = d[j-1] + d[j-2] + d[j-3]
print(d[n])
Reference
この問題について([白俊]9095), 我々は、より多くの情報をここで見つけました https://velog.io/@bschoi/백준9095テキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol