結果

問題 No.657 テトラナッチ数列 Easy
ユーザー pluto77pluto77
提出日時 2018-03-04 08:52:02
言語 Python2
(2.7.18)
結果
TLE  
実行時間 -
コード長 213 bytes
コンパイル時間 58 ms
コンパイル使用メモリ 6,700 KB
実行使用メモリ 14,568 KB
最終ジャッジ日時 2023-09-20 17:52:47
合計ジャッジ時間 5,447 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
10,300 KB
testcase_01 AC 11 ms
5,936 KB
testcase_02 AC 11 ms
5,844 KB
testcase_03 AC 12 ms
5,980 KB
testcase_04 AC 205 ms
13,076 KB
testcase_05 AC 29 ms
5,856 KB
testcase_06 AC 11 ms
5,884 KB
testcase_07 AC 11 ms
5,852 KB
testcase_08 AC 244 ms
14,568 KB
testcase_09 AC 1,042 ms
5,964 KB
testcase_10 TLE -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#yuki657

def tet(x):
 t=[0,0,0,1]
 for i in xrange(5,x+1):
  t+=[((t[-1]+t[-2]+t[-3]+t[-4])%17)]
 return t

q=int(raw_input())
for i in xrange(q):
 n=int(raw_input())
 if n<4:
  print 0
 else:
  print tet(n)[-1]
0