結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,964 KB
testcase_01 AC 14 ms
7,784 KB
testcase_02 AC 15 ms
7,844 KB
testcase_03 AC 14 ms
7,772 KB
testcase_04 AC 14 ms
7,800 KB
testcase_05 AC 14 ms
7,772 KB
testcase_06 AC 15 ms
7,804 KB
testcase_07 AC 15 ms
7,844 KB
testcase_08 AC 23 ms
12,964 KB
testcase_09 AC 505 ms
464,736 KB
testcase_10 MLE -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
権限があれば一括ダウンロードができます

ソースコード

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]
print(F[N-1]%M)
0