結果

問題 No.526 フィボナッチ数列の第N項をMで割った余りを求める
ユーザー lllllll88938494lllllll88938494
提出日時 2023-05-06 11:14:15
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 134 bytes
コンパイル時間 297 ms
コンパイル使用メモリ 87,368 KB
実行使用メモリ 87,660 KB
最終ジャッジ日時 2023-08-15 13:08:40
合計ジャッジ時間 3,036 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 88 ms
83,644 KB
testcase_01 AC 86 ms
83,860 KB
testcase_02 AC 92 ms
83,800 KB
testcase_03 AC 87 ms
83,976 KB
testcase_04 AC 88 ms
83,916 KB
testcase_05 AC 85 ms
83,988 KB
testcase_06 AC 90 ms
83,732 KB
testcase_07 AC 85 ms
83,708 KB
testcase_08 AC 88 ms
83,728 KB
testcase_09 AC 87 ms
83,732 KB
testcase_10 AC 88 ms
83,804 KB
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m=map(int,input().split())

f=[0]*10**6
f[1] = 1

for i in range(2,10**6):
    f[i] = f[i-2] + f[i-1]
    f[i] %= m

print(f[n-1]%m)
0