結果
問題 | No.657 テトラナッチ数列 Easy |
ユーザー |
|
提出日時 | 2020-05-12 21:25:44 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 345 ms / 2,000 ms |
コード長 | 457 bytes |
コンパイル時間 | 164 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 19,456 KB |
最終ジャッジ日時 | 2024-09-13 23:35:40 |
合計ジャッジ時間 | 6,682 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 13 |
ソースコード
import sys sys.setrecursionlimit(100000000) MOD = 17 INF = 10 ** 15 from bisect import bisect_left,bisect_right def main(): Q = int(input()) Ns = [int(input()) for _ in range(Q)] tetora = [0] * 1000001 tetora[4] = 1 for i in range(5,1000001): tetora[i] = tetora[i - 1] + tetora[i - 2] + tetora[i - 3] + tetora[i - 4] tetora[i] %= MOD print(*[tetora[q] for q in Ns],sep = '\n') if __name__ == '__main__': main()