結果
問題 |
No.526 フィボナッチ数列の第N項をMで割った余りを求める
|
ユーザー |
![]() |
提出日時 | 2017-08-03 09:53:53 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
RE
|
実行時間 | - |
コード長 | 161 bytes |
コンパイル時間 | 417 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 11,136 KB |
最終ジャッジ日時 | 2024-10-11 20:20:44 |
合計ジャッジ時間 | 1,633 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 4 RE * 8 |
ソースコード
N,M = [int(i) for i in input().split()] def fibonacci(n, a=1, b=1): return b if n < 1 else fibonacci(n-1, a+b , a) ff = fibonacci(N-1, a=1, b=0) print(ff%M)