結果

問題 No.526 フィボナッチ数列の第N項をMで割った余りを求める
ユーザー osrgy01osrgy01
提出日時 2021-02-16 10:39:42
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 108 bytes
コンパイル時間 418 ms
コンパイル使用メモリ 10,648 KB
実行使用メモリ 204,132 KB
最終ジャッジ日時 2023-10-09 21:42:57
合計ジャッジ時間 10,037 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,884 KB
testcase_01 AC 16 ms
7,728 KB
testcase_02 AC 16 ms
7,800 KB
testcase_03 AC 16 ms
7,888 KB
testcase_04 AC 16 ms
7,752 KB
testcase_05 AC 15 ms
7,736 KB
testcase_06 AC 15 ms
7,748 KB
testcase_07 AC 15 ms
7,828 KB
testcase_08 AC 20 ms
8,500 KB
testcase_09 AC 54 ms
11,816 KB
testcase_10 AC 377 ms
47,052 KB
testcase_11 TLE -
testcase_12 AC 1,530 ms
86,088 KB
testcase_13 TLE -
testcase_14 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M=map(int,input().split())
F=[0,1]+[0]*(N-2)
for i in range(2,N):
    F[i]=(F[i-1]+F[i-2])%M
print(F[N-1])
0