結果

問題 No.657 テトラナッチ数列 Easy
ユーザー pluto77pluto77
提出日時 2018-03-03 16:13:34
言語 PyPy2
(7.3.15)
結果
TLE  
実行時間 -
コード長 233 bytes
コンパイル時間 1,989 ms
コンパイル使用メモリ 77,276 KB
実行使用メモリ 84,216 KB
最終ジャッジ日時 2023-09-07 01:24:45
合計ジャッジ時間 7,342 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
76,280 KB
testcase_01 AC 70 ms
76,132 KB
testcase_02 AC 73 ms
76,136 KB
testcase_03 AC 73 ms
76,136 KB
testcase_04 AC 86 ms
77,956 KB
testcase_05 AC 116 ms
79,572 KB
testcase_06 AC 75 ms
76,388 KB
testcase_07 AC 72 ms
76,240 KB
testcase_08 AC 83 ms
77,976 KB
testcase_09 AC 150 ms
79,760 KB
testcase_10 AC 427 ms
79,820 KB
testcase_11 AC 422 ms
79,680 KB
testcase_12 TLE -
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