結果

問題 No.526 フィボナッチ数列の第N項をMで割った余りを求める
ユーザー surprise_tanakasurprise_tanaka
提出日時 2018-11-20 16:18:51
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 131 bytes
コンパイル時間 91 ms
コンパイル使用メモリ 10,744 KB
実行使用メモリ 12,636 KB
最終ジャッジ日時 2023-08-26 02:18:36
合計ジャッジ時間 4,039 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,976 KB
testcase_01 AC 17 ms
7,848 KB
testcase_02 AC 83 ms
7,996 KB
testcase_03 AC 15 ms
7,956 KB
testcase_04 AC 191 ms
7,796 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(n):
   if n <= 2:
     return 1
   else :
     return fib(n-1)+fib(n-2)

N,M = map(int,input().split())
print(fib(N-1) % M)
0