A10687 | PolandBall and Many Other Balls
时间限制1s
内存限制256MB
通过 / 提交0/0
题目描述
PolandBall is standing in a row with Many Other Balls. More precisely, there are exactly $n$ Balls. Balls are proud of their home land — and they want to prove that it's strong.
The Balls decided to start with selecting exactly $m$ groups of Balls, each consisting either of single Ball or two neighboring Balls. Each Ball can join no more than one group.
The Balls really want to impress their Enemies. They kindly asked you to calculate number of such divisions for all $m$ where $1<=m<=k$ . Output all these values modulo $998244353$ , the Enemies will be impressed anyway.
The Balls decided to start with selecting exactly $m$ groups of Balls, each consisting either of single Ball or two neighboring Balls. Each Ball can join no more than one group.
The Balls really want to impress their Enemies. They kindly asked you to calculate number of such divisions for all $m$ where $1<=m<=k$ . Output all these values modulo $998244353$ , the Enemies will be impressed anyway.
输入格式
There are exactly two numbers $n$ and $k$ ( $1<=n<=10^{9}$ , $1<=k<2^{15}$ ), denoting the number of Balls and the maximim number of groups, respectively.
输出格式
You should output a sequence of $k$ values. The $i$ -th of them should represent the sought number of divisions into exactly $i$ groups, according to PolandBall's rules.
输入输出样例
输入 #1
3 3
输出 #1
5 5 1
输入 #2
1 1
输出 #2
1
输入 #3
5 10
输出 #3
9 25 25 9 1 0 0 0 0 0
In the first sample case we can divide Balls into groups as follows:
${1}$ , ${2}$ , ${3}$ , ${12}$ , ${23}$ .
${12}{3}$ , ${1}{23}$ , ${1}{2}$ , ${1}{3}$ , ${2}{3}$ .
${1}{2}{3}$ .
Therefore, output is: 5 5 1.
${1}$ , ${2}$ , ${3}$ , ${12}$ , ${23}$ .
${12}{3}$ , ${1}{23}$ , ${1}{2}$ , ${1}{3}$ , ${2}{3}$ .
${1}{2}{3}$ .
Therefore, output is: 5 5 1.
C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted