問題一覧 > 通常問題

No.1100 Boxes

レベル : / AI推定難易度 : 1700 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 68
作問者 : SSRS / テスター : 37zigen
お気に入りにしたユーザー ProblemId : 4373 / 自分の提出
問題文最終更新日: 2020-06-26 08:14:01
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 254 (順位表) の他の問題:

Problem Statement

You put $N$ mutually distinguishable balls into $K$ mutually distinguishable boxes.
However, you want the number of boxes containing no balls to be odd.
Find the number of ways to put the balls that satisfy this condition.
Since the answer can be very large, output it modulo $998244353$.

Input

$N \ K$

The input satisfies the following constraints.

  • All inputs are integers
  • $1 \leq N \leq 10^7$
  • $1 \leq K \leq 10^5$

Output

Output the number of ways to put the balls that satisfy the condition, modulo $998244353$.

Sample

Sample 1
Input
2 3
Output
6

There are 2 balls and 3 boxes.
If the 2 balls are put into the same box, the number of boxes containing no balls is 2, which does not satisfy the condition.
If the 2 balls are put into different boxes, the number of boxes containing no balls is 1, which satisfies the condition.
Therefore, the answer equals the number of ways to put the 2 balls into different boxes, which is 6.

Sample 2
Input
4 1
Output
0

All the balls must be put into the same box, so no matter how they are put, the number of boxes containing no balls is 0 (even).

Sample 3
Input
5 4
Output
604

Sample 4
Input
1000 100
Output
656749944

Output the answer modulo $998244353$.

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。