結果

問題 No.526 フィボナッチ数列の第N項をMで割った余りを求める
ユーザー ydaigoydaigo
提出日時 2020-12-09 21:50:51
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 127 bytes
コンパイル時間 151 ms
コンパイル使用メモリ 81,840 KB
実行使用メモリ 86,512 KB
最終ジャッジ日時 2023-10-19 08:15:34
合計ジャッジ時間 4,129 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
57,896 KB
testcase_01 AC 51 ms
65,268 KB
testcase_02 AC 153 ms
74,664 KB
testcase_03 AC 39 ms
53,412 KB
testcase_04 AC 111 ms
74,896 KB
testcase_05 TLE -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = [int(i) for  i in input().split()]
def fib(n):
  if n<=1:
    return n
  return fib(n-2) + fib(n-1)
print(fib(N[0]-1)%N[1])
0