A14332 | AmShZ Farm
时间限制1s
内存限制256MB
通过 / 提交0/0
题目描述
To AmShZ, all arrays are equal, but some arrays are more-equal than others. Specifically, the arrays consisting of $n$ elements from $1$ to $n$ that can be turned into permutations of numbers from $1$ to $n$ by adding a non-negative integer to each element.
Mashtali who wants to appear in every problem statement thinks that an array $b$ consisting of $k$ elements is compatible with a more-equal array $a$ consisting of $n$ elements if for each $1 \le i \le k$ we have $1 \le b_i \le n$ and also $a_{b_1} = a_{b_2} = \ldots = a_{b_k}$ .
Find the number of pairs of arrays $a$ and $b$ such that $a$ is a more-equal array consisting of $n$ elements and $b$ is an array compatible with $a$ consisting of $k$ elements modulo $998244353$ .
Note that the elements of $b$ are not necessarily distinct, same holds for $a$ .
Mashtali who wants to appear in every problem statement thinks that an array $b$ consisting of $k$ elements is compatible with a more-equal array $a$ consisting of $n$ elements if for each $1 \le i \le k$ we have $1 \le b_i \le n$ and also $a_{b_1} = a_{b_2} = \ldots = a_{b_k}$ .
Find the number of pairs of arrays $a$ and $b$ such that $a$ is a more-equal array consisting of $n$ elements and $b$ is an array compatible with $a$ consisting of $k$ elements modulo $998244353$ .
Note that the elements of $b$ are not necessarily distinct, same holds for $a$ .
输入格式
The first line of input contains two integers $n$ and $k$ $(1 \le n \le 10^9 , 1 \le k \le 10^5)$ .
输出格式
Print a single integer — the answer to the problem modulo $998244353$ .
输入输出样例
输入 #1
1 1
输出 #1
1
输入 #2
2 2
输出 #2
8
输入 #3
5 4
输出 #3
50400
输入 #4
20 100
输出 #4
807645526
输入 #5
10000000 10000
输出 #5
883232350
There are eight possible pairs for the second example:
1. $a = \{1, 1\}, b = \{1, 1\}$
2. $a = \{1, 1\}, b = \{1, 2\}$
3. $a = \{1, 1\}, b = \{2, 1\}$
4. $a = \{1, 1\}, b = \{2, 2\}$
5. $a = \{1, 2\}, b = \{1, 1\}$
6. $a = \{1, 2\}, b = \{2, 2\}$
7. $a = \{2, 1\}, b = \{1, 1\}$
8. $a = \{2, 1\}, b = \{2, 2\}$
1. $a = \{1, 1\}, b = \{1, 1\}$
2. $a = \{1, 1\}, b = \{1, 2\}$
3. $a = \{1, 1\}, b = \{2, 1\}$
4. $a = \{1, 1\}, b = \{2, 2\}$
5. $a = \{1, 2\}, b = \{1, 1\}$
6. $a = \{1, 2\}, b = \{2, 2\}$
7. $a = \{2, 1\}, b = \{1, 1\}$
8. $a = \{2, 1\}, b = \{2, 2\}$
C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted