問題一覧 > 通常問題

No.3394 Big Binom

レベル : / AI推定難易度 : 1700 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 85
作問者 : Cafe1942 / テスター : sclara
お気に入りにしたユーザー ProblemId : 12903 / 自分の提出
問題文最終更新日: 2025-12-01 00:00:29
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
Advent Calendar Contest 2025 (順位表) の他の問題:

Problem Statement

There are $N$ distinguishable reindeer. How many combinations are there for choosing exactly $K$ reindeer from among them? Here, if the set of chosen reindeer is the same and only the order of choosing differs, the choices are considered the same.

Since the answer can be very large, report the answer modulo $998244353$.

Constraints

  • $1 \leq N \leq 10^{9}$
  • $0 \leq K \leq N$

Input

$N$ $K$

Output

Output the answer modulo $998244353$.

Sample

Sample 1
Input
5 3
Output
10

There are $10$ combinations for choosing exactly $3$ reindeer from $5$ distinguishable reindeer.

Sample 2
Input
33 16
Output
168558757

There are $1166803110$ combinations for choosing exactly $16$ reindeer from $33$ distinguishable reindeer. Output $168558757$, which is this number modulo $998244353$.

Sample 3
Input
998244355 2
Output
1
Sample 4
Input
998244355 3
Output
0

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