結果

問題 No.657 テトラナッチ数列 Easy
ユーザー fumofumofunifumofumofuni
提出日時 2023-06-21 01:06:02
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 171 ms / 2,000 ms
コード長 178 bytes
コンパイル時間 370 ms
コンパイル使用メモリ 87,004 KB
実行使用メモリ 85,424 KB
最終ジャッジ日時 2023-09-10 20:43:29
合計ジャッジ時間 3,333 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 95 ms
83,940 KB
testcase_01 AC 94 ms
83,868 KB
testcase_02 AC 99 ms
83,784 KB
testcase_03 AC 93 ms
83,780 KB
testcase_04 AC 90 ms
84,104 KB
testcase_05 AC 171 ms
85,108 KB
testcase_06 AC 92 ms
83,992 KB
testcase_07 AC 91 ms
83,932 KB
testcase_08 AC 93 ms
83,896 KB
testcase_09 AC 145 ms
85,300 KB
testcase_10 AC 147 ms
85,308 KB
testcase_11 AC 145 ms
85,424 KB
testcase_12 AC 145 ms
85,028 KB
testcase_13 AC 150 ms
85,140 KB
testcase_14 AC 145 ms
85,280 KB
testcase_15 AC 148 ms
85,300 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=1000100
A=[0]*N
A[3]=1
for i in range(4,N):
    A[i]=A[i-1]+A[i-2]+A[i-3]+A[i-4]
    A[i]%=17

Q=int(input())
for _ in range(Q):
    p=int(input())
    p-=1
    print(A[p])



0