結果

問題 No.526 フィボナッチ数列の第N項をMで割った余りを求める
ユーザー _EnumHack_EnumHack
提出日時 2017-06-10 01:08:08
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 170 bytes
コンパイル時間 127 ms
コンパイル使用メモリ 11,744 KB
実行使用メモリ 14,424 KB
最終ジャッジ日時 2023-10-24 04:35:27
合計ジャッジ時間 4,435 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

def fib_mod(n,m):
    if n < 2:
        return n
    return (fib_mod(n-2,m) + fib_mod(n-1,m)) % m

print((lambda n,m: fib_mod(n-1,m))(*[int(_) for _ in input().split()]))
0