結果

問題 No.526 フィボナッチ数列の第N項をMで割った余りを求める
ユーザー nohakai3nohakai3
提出日時 2022-08-02 11:24:25
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 127 bytes
コンパイル時間 93 ms
コンパイル使用メモリ 10,744 KB
実行使用メモリ 204,084 KB
最終ジャッジ日時 2023-09-30 10:08:50
合計ジャッジ時間 10,131 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
47,060 KB
testcase_01 AC 67 ms
47,188 KB
testcase_02 AC 67 ms
47,096 KB
testcase_03 AC 67 ms
47,220 KB
testcase_04 AC 66 ms
46,988 KB
testcase_05 AC 67 ms
47,232 KB
testcase_06 AC 67 ms
47,020 KB
testcase_07 AC 67 ms
47,144 KB
testcase_08 AC 70 ms
47,408 KB
testcase_09 AC 98 ms
50,372 KB
testcase_10 AC 411 ms
78,504 KB
testcase_11 AC 1,961 ms
203,864 KB
testcase_12 AC 1,492 ms
46,992 KB
testcase_13 TLE -
testcase_14 AC 1,916 ms
203,836 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m=map(int,input().split())
dp=[0]*5010101
dp[1]=0
dp[2]=1
for i in range(3,n+1):
    dp[i]=(dp[i-1]+dp[i-2])%m


print(dp[n])
0