結果
| 問題 | No.526 フィボナッチ数列の第N項をMで割った余りを求める |
| コンテスト | |
| ユーザー |
_KingdomOfMoray
|
| 提出日時 | 2020-01-06 22:01:31 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
AC
|
| 実行時間 | 1,495 ms / 2,000 ms |
| コード長 | 222 bytes |
| 記録 | |
| コンパイル時間 | 344 ms |
| コンパイル使用メモリ | 20,568 KB |
| 実行使用メモリ | 15,360 KB |
| 最終ジャッジ日時 | 2026-05-16 22:14:01 |
| 合計ジャッジ時間 | 7,649 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 12 |
ソースコード
input_list = list(map(int,input().split()))
n, m = input_list
front2 = 0 % m
front1 = 1 % m
cur = front2 + front1
for i in range(4, n + 1):
front2 = front1
front1 = cur
cur = (front2 + front1) % m
print(cur)
_KingdomOfMoray