Universal Cup Judging System

Universal Cup

Límite de tiempo: 2.0 s Límite de memoria: 1024 MB Puntuación total: 100 Hackeable ✓
Estadísticas

畀定一個正整數 $N$ 同一個大細為 $M$ 嘅整數集合 $S = \{S_1, S_2, \dots, S_M\}$。

對於每個 $k = 0, 1, \dots, N - 3$,請回答以下問題:

考慮一個頂點編號為 $1, 2, \dots, N$ 嘅正 $N$ 邊形。畫出啱啱好 $k$ 條對角線,令到任意兩條對角線除咗可能喺端點相交之外,無其他交點。咁樣,呢個正 $N$ 邊形就會被分割成 $k + 1$ 個多邊形。設 $e_1, e_2, \dots, e_{k+1}$ 分別係呢啲多邊形嘅邊數。

如果一種畫 $k$ 條對角線嘅方法滿足以下條件,我哋就話佢係一種好方法:

  • $e_1, e_2, \dots, e_{k+1}$ 全部都包含喺集合 $S$ 入面。

求畫 $k$ 條對角線嘅好方法數量,對 $998244353$ 取模。

輸入格式

輸入按以下格式畀出:

N M
S1 S2 ... SM
  • 所有輸入數值都係整數。
  • $3 \le N \le 10^5$
  • $1 \le M \le N - 2$
  • $3 \le S_i \le N$
  • $S_i < S_{i+1}$

輸出格式

輸出 $N - 2$ 行。對於 $i = 1, 2, \dots, N - 2$,喺第 $i$ 行輸出對應於 $k = i - 1$ 嘅答案。

範例

範例輸入 1

5 2
3 4

範例輸出 1

0
5
5

範例輸入 2

4 1
4

範例輸出 2

1
0

範例輸入 3

16 7
3 4 6 7 9 12 16

範例輸出 3

1
24
544
14280
120156
829464
3372120
10914816
24515700
40532624
52300160
42493880
17383860
2674440

提示

喺第一個範例入面,當 $k = 0$ 嗰陣,總係有 $e_1 = 5$。因為 $5$ 唔喺 $S$ 入面,所以答案係 $0$。

當 $k = 1$ 嗰陣,總係有 $\{e_1, e_2\} = \{3, 4\}$,而且兩個數值都喺 $S$ 入面。喺正五邊形入面畫一條對角線有 $5$ 種方法,所以答案係 $5$。

當 $k = 2$ 嗰陣,總係有 $e_i = 3$($1 \le i \le 3$)。喺正五邊形入面畫兩條唔相交嘅對角線有 $5$ 種方法,所以答案係 $5$。

problem_16235_1.png

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.