結果
問題 | No.526 フィボナッチ数列の第N項をMで割った余りを求める |
ユーザー |
![]() |
提出日時 | 2020-01-06 19:38:52 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 196 bytes |
コンパイル時間 | 117 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 11,136 KB |
最終ジャッジ日時 | 2024-11-23 00:06:07 |
合計ジャッジ時間 | 1,262 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 3 WA * 2 RE * 7 |
ソースコード
import mathinput_list = list(map(int,input().split()))n, m = input_listn -= 1fn = (((1 + math.sqrt(5)) / 2) ** n - ((1 - math.sqrt(5)) / 2) ** n) / math.sqrt(5)res = int(fn) % mprint(res)