結果

問題 No.526 フィボナッチ数列の第N項をMで割った余りを求める
ユーザー JunOnumaJunOnuma
提出日時 2017-06-12 14:35:18
言語 Python2
(2.7.18)
結果
MLE  
実行時間 -
コード長 145 bytes
コンパイル時間 46 ms
コンパイル使用メモリ 7,096 KB
実行使用メモリ 818,092 KB
最終ジャッジ日時 2023-10-24 21:32:10
合計ジャッジ時間 5,088 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
6,468 KB
testcase_01 AC 11 ms
6,428 KB
testcase_02 AC 10 ms
6,428 KB
testcase_03 AC 9 ms
6,428 KB
testcase_04 AC 9 ms
6,428 KB
testcase_05 AC 10 ms
6,428 KB
testcase_06 AC 11 ms
6,428 KB
testcase_07 AC 11 ms
6,496 KB
testcase_08 AC 20 ms
11,548 KB
testcase_09 AC 590 ms
464,236 KB
testcase_10 MLE -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m = map(int, raw_input().split())
l = [0 for _ in range(n)]
l[1] = 1
i = 2
while i < n:
    l[i] = l[i-1] + l[i-2]
    i += 1
print l[n-1] % m
0