第三届 AtCoder Japan Open -预选-(第 232 场 AtCoder Regular Contest++)
E
加倍
Doubling
AtCoder
⌀ 3596
原题
← D→

加倍AI (CI翻译)

Problem Statement

题目描述

AI (CI翻译)

You are given a sequence of non-negative integers of length $N+1$, $X=(X_1,X_2,\ldots,X_{N+1})$, where $X_{N+1}=0$.

给定一个长度为 $N+1$ 的非负整数序列 $X=(X_1,X_2,\ldots,X_{N+1})$,其中 $X_{N+1}=0$。AI (CI翻译)

You can perform the following operation.

你可以进行以下操作:AI (CI翻译)

  • Choose an integer $i$ satisfying $1 \leq i \leq N$ and $X_i \geq 1$, subtract $1$ from $X_i$, and add $2$ to $X_{i+1}$.
  • 选择一个满足 $1 \leq i \leq N$ 且 $X_i \geq 1$ 的整数 $i$,将 $X_i$ 减少 $1$,并将 $X_{i+1}$ 增加 $2$。
AI (CI翻译)

You are given an integer $K$. For each $k=1,2,\ldots,K$, find the number, modulo $998244353$, of sequences that can result from performing the operation exactly $k$ times on the given sequence.

给定一个整数 $K$。对于每个 $k=1,2,\ldots,K$,求对给定序列恰好进行 $k$ 次操作后可能得到的序列数量,答案对 $998244353$ 取模。AI (CI翻译)

Constraints

约束条件

AI (CI翻译)
  • $1 \leq N \leq 20$
  • $1 \leq K \leq 250000$
  • $0 \leq X_i \leq 250000$ $(1 \leq i \leq N)$
  • $X_{N+1}=0$
  • All input values are integers.
  • $1 \leq N \leq 20$
  • $1 \leq K \leq 250000$
  • $0 \leq X_i \leq 250000$ $(1 \leq i \leq N)$
  • $X_{N+1}=0$
  • 所有输入值均为整数。
AI (CI翻译)

Input

输入格式

AI (CI翻译)

The input is given from Standard Input in the following format. $X_{N+1}$ is not included in the input.

输入通过标准输入给出,格式如下。输入中不包含 $X_{N+1}$。AI (CI翻译)

N K
X_1 X_2 \ldots X_N

N K
X_1 X_2 \ldots X_N
AI (CI翻译)

Output

输出格式

AI (CI翻译)

Output the answers for $k=1,2,\cdots,K$ in this order, separated by spaces, on a single line.

在一行中按顺序输出 $k=1,2,\cdots,K$ 对应的答案,并用空格分隔。AI (CI翻译)

样例

Input #1
2 5
1 1
Output #1
2 1 1 1 0
The sequences that can result from performing the operation once are $(0,3,0)$ and $(1,0,2)$, so there are two of them. The only sequence that can result from performing the operation twice is $(0,2,2)$, so there is one. Multiple orders of operations yield this sequence, but it is counted as one sequence.
Input #2
2 4
1 0
Output #2
1 1 1 0
The initial sequence is $(1,0,0)$. With each operation, the sequence changes to $(0,2,0)$, $(0,1,2)$, $(0,0,4)$. The operation cannot be performed four times.
Input #3
1 1
0
Output #3
0
Input #4
3 4
0 0 2
Output #4
1 1 0 0
Input #5
4 7
1 0 1 0
Output #5
2 3 4 4 5 5 5
题目信息
题号
arc232_e
时间限制
2 s
内存限制
1024 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(gpt-6.1-sol),如有出入请以原文为准。