結果
| 問題 |
No.980 Fibonacci Convolution Hard
|
| コンテスト | |
| ユーザー |
ayaoni
|
| 提出日時 | 2020-12-09 18:18:46 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 952 ms / 2,000 ms |
| コード長 | 298 bytes |
| コンパイル時間 | 712 ms |
| コンパイル使用メモリ | 81,952 KB |
| 実行使用メモリ | 228,136 KB |
| 最終ジャッジ日時 | 2024-09-19 01:21:37 |
| 合計ジャッジ時間 | 19,417 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 17 |
ソースコード
p = int(input())
mod = 10**9+7
B = [1,(2*p) % mod,(3*p**2+2) % mod,(4*p**3+6*p) % mod]
for _ in range(2*10**6):
B.append((2*p*B[-1]-(p**2-2)*B[-2]-2*p*B[-3]-B[-4]) % mod)
Q = int(input())
for _ in range(Q):
q = int(input())
if q <= 3:
print(0)
else:
print(B[q-4])
ayaoni