結果
| 問題 | No.978 Fibonacci Convolution Easy |
| コンテスト | |
| ユーザー |
c-yan
|
| 提出日時 | 2020-11-28 00:32:23 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 359 bytes |
| 記録 | |
| コンパイル時間 | 623 ms |
| コンパイル使用メモリ | 20,700 KB |
| 実行使用メモリ | 171,140 KB |
| 最終ジャッジ日時 | 2026-04-03 18:30:27 |
| 合計ジャッジ時間 | 6,961 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 RE * 1 |
ソースコード
from itertools import accumulate
N, p = map(int, input().split())
m = 1000000007
a = [0] * (N + 1)
a[1] = 0
a[2] = 1
for i in range(3, N + 1):
a[i] = (p * a[i - 1] + a[i - 2]) % m
c = [0] * (N + 1)
for i in range(1, N + 1):
c[i] = (c[i - 1] + a[i]) % m
result = 0
for i in range(1, N + 1):
result += a[i] * c[i]
result %= m
print(result)
c-yan