加倍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$。
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$- 所有输入值均为整数。
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_NAI (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翻译)
样例
2 5
1 1
2 1 1 1 0
2 4
1 0
1 1 1 0
1 1
0
0
3 4
0 0 2
1 1 0 0
4 7
1 0 1 0
2 3 4 4 5 5 5
题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(gpt-6.1-sol),如有出入请以原文为准。