結果

問題 No.526 フィボナッチ数列の第N項をMで割った余りを求める
ユーザー ああいいああいい
提出日時 2021-12-05 20:32:01
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 147 bytes
コンパイル時間 88 ms
コンパイル使用メモリ 10,488 KB
実行使用メモリ 203,996 KB
最終ジャッジ日時 2023-09-21 15:00:34
合計ジャッジ時間 10,960 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,836 KB
testcase_01 AC 16 ms
7,748 KB
testcase_02 AC 15 ms
7,836 KB
testcase_03 AC 16 ms
7,864 KB
testcase_04 AC 16 ms
7,880 KB
testcase_05 AC 15 ms
7,796 KB
testcase_06 AC 16 ms
7,836 KB
testcase_07 AC 16 ms
7,768 KB
testcase_08 AC 20 ms
8,200 KB
testcase_09 AC 63 ms
11,992 KB
testcase_10 AC 449 ms
47,060 KB
testcase_11 TLE -
testcase_12 AC 1,858 ms
47,204 KB
testcase_13 TLE -
testcase_14 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M = list(map(int,input().split()))

F = [0] * (N+1)
F[1] = 0
F[2] = 1
for i in range(3,N+1):
    F[i] = F[i-1] + F[i-2]
    F[i] %= M
print(F[N])
0