結果

問題 No.526 フィボナッチ数列の第N項をMで割った余りを求める
ユーザー c-yanc-yan
提出日時 2020-09-06 01:04:29
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 122 bytes
コンパイル時間 237 ms
コンパイル使用メモリ 10,644 KB
実行使用メモリ 7,980 KB
最終ジャッジ日時 2023-08-19 13:20:28
合計ジャッジ時間 9,334 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,792 KB
testcase_01 AC 15 ms
7,932 KB
testcase_02 AC 16 ms
7,944 KB
testcase_03 AC 15 ms
7,800 KB
testcase_04 AC 16 ms
7,756 KB
testcase_05 AC 16 ms
7,784 KB
testcase_06 AC 16 ms
7,788 KB
testcase_07 AC 16 ms
7,752 KB
testcase_08 AC 19 ms
7,780 KB
testcase_09 AC 50 ms
7,980 KB
testcase_10 AC 332 ms
7,756 KB
testcase_11 AC 1,977 ms
7,796 KB
testcase_12 AC 1,600 ms
7,948 KB
testcase_13 TLE -
testcase_14 AC 1,909 ms
7,840 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, M = map(int, input().split())

a = 0
b = 1
for i in range(N - 2):
    t = a + b
    a = b
    b = t
    b %= M
print(b)
0