結果

問題 No.657 テトラナッチ数列 Easy
ユーザー twkmath
提出日時 2018-03-07 00:01:03
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
RE  
実行時間 -
コード長 275 bytes
コンパイル時間 104 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 17,824 KB
最終ジャッジ日時 2024-09-22 03:42:17
合計ジャッジ時間 3,923 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 TLE * 1
other AC * 5 RE * 1 -- * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

def tetra_nacci(k):
	if k<4:
		return 0
	elif k==4:
		return 1
	else:
		return tetra_nacci(k-1)+tetra_nacci(k-2)+tetra_nacci(k-3)+tetra_nacci(k-4)

q = int(input())
n_lst = [0]*q
for i in range(q):
	n_lst[i] = int(input())

for i in range(q):
	print(tetra_nacci(n_lst[i])%17)
0