結果

問題 No.526 フィボナッチ数列の第N項をMで割った余りを求める
ユーザー titiatitia
提出日時 2024-02-01 02:38:55
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 244 ms / 2,000 ms
コード長 111 bytes
コンパイル時間 311 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 233,964 KB
最終ジャッジ日時 2024-02-01 02:39:01
合計ジャッジ時間 5,673 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 238 ms
233,964 KB
testcase_01 AC 233 ms
233,964 KB
testcase_02 AC 221 ms
233,964 KB
testcase_03 AC 229 ms
233,964 KB
testcase_04 AC 220 ms
233,964 KB
testcase_05 AC 221 ms
233,964 KB
testcase_06 AC 218 ms
233,964 KB
testcase_07 AC 214 ms
233,964 KB
testcase_08 AC 222 ms
233,964 KB
testcase_09 AC 221 ms
233,964 KB
testcase_10 AC 218 ms
233,964 KB
testcase_11 AC 216 ms
233,964 KB
testcase_12 AC 206 ms
233,836 KB
testcase_13 AC 244 ms
233,964 KB
testcase_14 AC 210 ms
233,964 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

F=[0,0,1,1]

for i in range(5000000):
    F.append((F[-1]+F[-2])%m)

print(F[n])
0