結果

問題 No.526 フィボナッチ数列の第N項をMで割った余りを求める
ユーザー lllllll88938494lllllll88938494
提出日時 2023-05-06 11:14:15
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 134 bytes
コンパイル時間 151 ms
コンパイル使用メモリ 82,388 KB
実行使用メモリ 75,260 KB
最終ジャッジ日時 2024-05-03 00:39:57
合計ジャッジ時間 1,738 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 58 ms
65,792 KB
testcase_01 AC 55 ms
65,664 KB
testcase_02 AC 53 ms
65,664 KB
testcase_03 AC 53 ms
65,920 KB
testcase_04 AC 51 ms
65,664 KB
testcase_05 AC 52 ms
65,792 KB
testcase_06 AC 54 ms
65,664 KB
testcase_07 AC 49 ms
65,536 KB
testcase_08 AC 50 ms
66,048 KB
testcase_09 AC 51 ms
65,664 KB
testcase_10 AC 52 ms
65,996 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