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 nn elements from 11 to nn that can be turned into permutations of numbers from 11 to nn by adding a non-negative integer to each element.

Mashtali who wants to appear in every problem statement thinks that an array bb consisting of kk elements is compatible with a more-equal array aa consisting of nn elements if for each 1≤i≤k1 \le i \le k we have 1≤bi≤n1 \le b_i \le n and also ab1=ab2=…=abka_{b_1} = a_{b_2} = \ldots = a_{b_k}.

Find the number of pairs of arrays aa and bb such that aa is a more-equal array consisting of nn elements and bb is an array compatible with aa consisting of kk elements modulo 998244353998244353.

Note that the elements of bb are not necessarily distinct, same holds for aa.

对 AmShZ 而言,所有数组都是相等的,但有些数组比其他数组“更相等”。具体来说,“更相等”的数组是指:由 11 到 nn 中的 nn 个元素组成的数组,且可通过给每个元素加上某个非负整数,将其变为 11 到 nn 的一个排列。

Mashtali 希望在每道题的题面中都露脸,他定义:若数组 bb(含 kk 个元素)满足对每个 1≤i≤k1 \le i \le k 都有 1≤bi≤n1 \le b_i \le n,且 ab1=ab2=…=abka_{b_1} = a_{b_2} = \ldots = a_{b_k},则称 bb 与“更相等”数组 aa(含 nn 个元素)兼容。

求满足如下条件的数组对 (a,b)(a, b) 的个数(对 998244353998244353 取模):

  • aa 是一个含 nn 个元素的“更相等”数组;
  • bb 是一个与 aa 兼容的、含 kk 个元素的数组。

注意:bb 的元素不一定互异,aa 的元素同样不一定互异。

输入格式

The first line of input contains two integers nn and kk (1≤n≤109,1≤k≤105)(1 \le n \le 10^9 , 1 \le k \le 10^5).

输入的第一行包含两个整数 nn 和 kk (1≤n≤109,1≤k≤105)(1 \le n \le 10^9 , 1 \le k \le 10^5)。

输出格式

Print a single integer — the answer to the problem modulo 998244353998244353.

输出一个整数——该问题答案对 998244353998244353 取模的结果。

输入输出样例

  • 输入#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,1a = {1, 1}, b = {1, 1}
  2. a=1,1,b=1,2a = {1, 1}, b = {1, 2}
  3. a=1,1,b=2,1a = {1, 1}, b = {2, 1}
  4. a=1,1,b=2,2a = {1, 1}, b = {2, 2}
  5. a=1,2,b=1,1a = {1, 2}, b = {1, 1}
  6. a=1,2,b=2,2a = {1, 2}, b = {2, 2}
  7. a=2,1,b=1,1a = {2, 1}, b = {1, 1}
  8. a=2,1,b=2,2a = {2, 1}, b = {2, 2}

第二个示例共有八种可能的数对:

  1. a=1,1,b=1,1a = {1, 1}, b = {1, 1}
  2. a=1,1,b=1,2a = {1, 1}, b = {1, 2}
  3. a=1,1,b=2,1a = {1, 1}, b = {2, 1}
  4. a=1,1,b=2,2a = {1, 1}, b = {2, 2}
  5. a=1,2,b=1,1a = {1, 2}, b = {1, 1}
  6. a=1,2,b=2,2a = {1, 2}, b = {2, 2}
  7. a=2,1,b=1,1a = {2, 1}, b = {1, 1}
  8. a=2,1,b=2,2a = {2, 1}, b = {2, 2}

输入解题思路,AI测评打分。不知道怎么写?

首页