CF1528F.AmShZ Farm
NOI/NOI+/CTSC
通过率:0%
时间限制:2.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
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≤i≤k we have 1≤bi≤n and also ab1=ab2=…=abk.
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.
对 AmShZ 而言,所有数组都是相等的,但有些数组比其他数组“更相等”。具体来说,“更相等”的数组是指:由 1 到 n 中的 n 个元素组成的数组,且可通过给每个元素加上某个非负整数,将其变为 1 到 n 的一个排列。
Mashtali 希望在每道题的题面中都露脸,他定义:若数组 b(含 k 个元素)满足对每个 1≤i≤k 都有 1≤bi≤n,且 ab1=ab2=…=abk,则称 b 与“更相等”数组 a(含 n 个元素)兼容。
求满足如下条件的数组对 (a,b) 的个数(对 998244353 取模):
- a 是一个含 n 个元素的“更相等”数组;
- b 是一个与 a 兼容的、含 k 个元素的数组。
注意:b 的元素不一定互异,a 的元素同样不一定互异。
输入格式
The first line of input contains two integers n and k (1≤n≤109,1≤k≤105).
输入的第一行包含两个整数 n 和 k (1≤n≤109,1≤k≤105)。
输出格式
Print a single integer — the answer to the problem modulo 998244353.
输出一个整数——该问题答案对 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:
- a=1,1,b=1,1
- a=1,1,b=1,2
- a=1,1,b=2,1
- a=1,1,b=2,2
- a=1,2,b=1,1
- a=1,2,b=2,2
- a=2,1,b=1,1
- a=2,1,b=2,2
第二个示例共有八种可能的数对:
- a=1,1,b=1,1
- a=1,1,b=1,2
- a=1,1,b=2,1
- a=1,1,b=2,2
- a=1,2,b=1,1
- a=1,2,b=2,2
- a=2,1,b=1,1
- a=2,1,b=2,2
输入解题思路,AI测评打分。不知道怎么写?