問題一覧 > 通常問題

No.2141 Enumeratest

レベル : / AI推定難易度 : 825 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 159
作問者 : milkcoffee / テスター : 👑 p-adic nok0
お気に入りにしたユーザー ProblemId : 8003 / 自分の提出
問題文最終更新日: 2022-11-25 22:34:03
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 370 (順位表) の他の問題:

Problem Statement

Consider a sequence $A$ of non-negative integers of length $N$ whose sum is $M$.

Let $A_i$ be the $i$-th element of $A$. For $A$, let $f(A)$ be the answer to the following problem.

There are $N$ boxes and $M$ balls. The boxes are numbered $1, \dots ,N$ and the balls are numbered $1, \dots ,M$, and they are distinguishable from one another.

For each $i$, put $A_i$ balls into the $i$-th box. How many ways are there to put the balls?

Find the maximum value of $f(A)$, modulo $998244353$.

Input

$N$ $M$

  • $1 \leq N,M \leq 10^6$
  • All inputs are integers.
  • Output

    Output the maximum value of $f(A)$, modulo $998244353$.

    Sample

    Sample 1
    Input
    2 3
    
    Output
    3
    

    When $A=(0,3)$, $f(A)=1$.
    When $A=(1,2)$, $f(A)=3$.
    When $A=(2,1)$, $f(A)=3$.
    When $A=(3,0)$, $f(A)=1$.
    Therefore, the maximum value of $f(A)$ is $3$.

    Sample 2
    Input
    1 1
    
    Output
    1
    

    Sample 3
    Input
    29847 234098 
    
    Output
    708115871
    

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