結果
| 問題 |
No.526 フィボナッチ数列の第N項をMで割った余りを求める
|
| コンテスト | |
| ユーザー |
_KingdomOfMoray
|
| 提出日時 | 2020-01-06 21:46:12 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 232 bytes |
| コンパイル時間 | 113 ms |
| コンパイル使用メモリ | 12,416 KB |
| 実行使用メモリ | 10,752 KB |
| 最終ジャッジ日時 | 2024-11-23 00:06:33 |
| 合計ジャッジ時間 | 10,165 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 9 TLE * 3 |
ソースコード
input_list = list(map(int,input().split()))
n, m = input_list
front2 = 0 % m
front1 = 1 % m
cur = None
for i in range(3, n + 1):
cur = front2 + front1
front2 = front1 % m
front1 = cur % m
res = cur % m
print(res)
_KingdomOfMoray