結果

問題 No.657 テトラナッチ数列 Easy
ユーザー pluto77pluto77
提出日時 2018-03-03 16:13:07
言語 Python2
(2.7.18)
結果
TLE  
実行時間 -
コード長 233 bytes
コンパイル時間 421 ms
コンパイル使用メモリ 6,588 KB
実行使用メモリ 6,144 KB
最終ジャッジ日時 2023-09-07 01:23:48
合計ジャッジ時間 5,823 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
6,144 KB
testcase_01 AC 11 ms
5,972 KB
testcase_02 AC 11 ms
5,948 KB
testcase_03 AC 11 ms
5,868 KB
testcase_04 AC 126 ms
5,852 KB
testcase_05 AC 31 ms
5,968 KB
testcase_06 AC 11 ms
5,860 KB
testcase_07 AC 11 ms
5,864 KB
testcase_08 AC 151 ms
5,948 KB
testcase_09 AC 668 ms
5,868 KB
testcase_10 TLE -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#yuki657

def tet(n):
 a,b,c,d=0,0,0,1
 if n<4:
  return 0
 if n==4:
  return 1
 for i in xrange(5,n+1):
  temp=(a+b+c+d)%17
  a,b,c,d=b,c,d,temp
 return d

q=int(raw_input())
for i in xrange(q):
 m=int(raw_input())
 print tet(m)%17
0