結果

問題 No.526 フィボナッチ数列の第N項をMで割った余りを求める
ユーザー kutaragi36kutaragi36
提出日時 2023-05-28 04:41:30
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 151 bytes
コンパイル時間 276 ms
コンパイル使用メモリ 87,028 KB
実行使用メモリ 115,212 KB
最終ジャッジ日時 2023-08-27 03:44:43
合計ジャッジ時間 2,982 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
115,008 KB
testcase_01 AC 118 ms
114,868 KB
testcase_02 AC 123 ms
115,204 KB
testcase_03 AC 118 ms
115,008 KB
testcase_04 AC 120 ms
115,020 KB
testcase_05 AC 117 ms
115,212 KB
testcase_06 AC 118 ms
115,152 KB
testcase_07 AC 106 ms
114,972 KB
testcase_08 AC 120 ms
115,108 KB
testcase_09 AC 120 ms
115,108 KB
testcase_10 AC 120 ms
115,052 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N, MOD = map(int, input().split())
Z = 5*10**6

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

print(F[N])
0