結果

問題 No.526 フィボナッチ数列の第N項をMで割った余りを求める
ユーザー NoNo
提出日時 2017-06-10 08:10:10
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
MLE  
実行時間 -
コード長 137 bytes
コンパイル時間 490 ms
コンパイル使用メモリ 11,756 KB
実行使用メモリ 816,624 KB
最終ジャッジ日時 2023-10-24 20:21:44
合計ジャッジ時間 3,179 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
10,032 KB
testcase_01 AC 28 ms
10,032 KB
testcase_02 AC 29 ms
10,032 KB
testcase_03 AC 28 ms
10,032 KB
testcase_04 AC 26 ms
10,032 KB
testcase_05 AC 26 ms
10,032 KB
testcase_06 AC 26 ms
10,032 KB
testcase_07 AC 26 ms
10,108 KB
testcase_08 AC 34 ms
14,912 KB
testcase_09 AC 752 ms
466,916 KB
testcase_10 MLE -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

ss = input().split()
n = int(ss[0])
m = int(ss[1])
f = [0,1]

for i in range(2,n):
    f.append(f[i - 1] + f[i - 2])

print(f[n - 1] % m)
0