QOJ.ac

QOJ

実行時間制限: 1.5 s メモリ制限: 256 MB 満点: 100

#10358. 多項式

統計

給定 $n$,$m$,$a$,$b$,$c$。定義 $f_0(x)=1$,對於 $k>0$,$f_k(x)=\sum_{i=0}^x (a i^2 + b i + c) f_{k-1}(i)$。對於 $0 \le i < n$ 的整數 $i$,求出 $f_i(m)$ 模 $1004535809$ 的值。

輸入格式

一行五個非負整數 $n$,$m$,$a$,$b$,$c$。

輸出格式

$n$ 行,每行一個整數,第 $i$ 行的整數表示 $f_{i-1}(m)$ 模 $1004535809$ 的值。

範例

範例輸入

5 10 0 1 2

範例輸出

1
77
3289
103103
2650648

說明

$f_0(x) = 1$

$f_1(x) = \frac{1}{2} x^2 + \frac{5}{2} x + 2$

$f_2(x) = \frac{1}{8} x^4 + \frac{17}{12} x^3 + \frac{43}{8} x^2 + \frac{97}{12} x + 4$

$f_3(x) = \frac{1}{48} x^6 + \frac{19}{48} x^5 + \frac{47}{16} x^4 + \frac{175}{16} x^3 + \frac{517}{24} x^2 + \frac{127}{6} x + 8$

$f_4(x) = \frac{1}{384} x^8 + \frac{7}{96} x^7 + \frac{491}{576} x^6 + \frac{1307}{240} x^5 + \frac{23971}{1152} x^4 + \frac{1557}{32} x^3 + \frac{19537}{288} x^2 + \frac{2053}{40} x + 16$

資料範圍

資料編號

$n$

$m$

$a$

$b$

$c$

0

$2000$

$\le 2000$

$\le 10^9$

$\le 10^9$

$\le 10^9$

1

$300$

$\le 10^9$

2

$1000$

3

$2000$

4

$250000$

$0$

$0$

5

$\le 2000$

$\le 10^9$

$\le 10^9$

6

$\le 50000$

7

$50000$

$\le 10^9$

$0$

$1$

$0$

8

$\le 10^9$

$\le 10^9$

9

$250000$

$1$

$0$

10

$\le 10^9$

11

$\le 10^9$

12

$50000$

$1$

$0$

$0$

13

$\le 10^9$

$\le 10^9$

$\le 10^9$

14

$100000$

$1$

$0$

$0$

15

$\le 10^9$

$\le 10^9$

16

$\le 10^9$

17

$250000$

$1$

$0$

$0$

18

$\le 10^9$

$\le 10^9$

19

$\le 10^9$

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.