結果

問題 No.526 フィボナッチ数列の第N項をMで割った余りを求める
ユーザー JunOnumaJunOnuma
提出日時 2017-06-12 14:34:45
言語 Python2
(2.7.18)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 147 bytes
コンパイル時間 42 ms
コンパイル使用メモリ 7,052 KB
実行使用メモリ 204,436 KB
最終ジャッジ日時 2023-10-24 21:32:02
合計ジャッジ時間 9,392 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

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]) % m
    i += 1
print l[n-1]
0