問題一覧 > 通常問題

No.2199 lower_bound and upper_bound

レベル : / AI推定難易度 : 1900 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 52
作問者 : 👑 箱星 / テスター : 👑 AngrySadEight
お気に入りにしたユーザー ProblemId : 8089 / 自分の提出
問題文最終更新日: 2022-12-27 20:12:31
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 374 (順位表) の他の問題:

Problem Statement

Find the number, modulo $998244353$, of integer sequences $A_1,A_2,\ldots,A_N$ of length $N$ satisfying all of the following conditions.

  • Each $A_i$ is an integer greater than or equal to $-1$.
  • $A_1+\cdots+A_N\ge L$
  • $A_1+\cdots+A_i\le U$ for $i=1,2,\ldots,N$.

Constraints

  • $1\le N\le 10^5$
  • $0\le L\le U\le 10^5$
  • All input values are integers.

Input

$N$ $L$ $U$

Output

Output the number of sequences modulo $998244353$.

Sample

Sample 1
Input
2 0 1
Output
6

The following $6$ sequences satisfy the conditions.

  • $(-1,1)$
  • $(-1,2)$
  • $(0,0)$
  • $(0,1)$
  • $(1,-1)$
  • $(1,0)$
Sample 2
Input
4 1 6
Output
840

Sample 3
Input
1234 5 6789
Output
322751743

Find the answer modulo $998244353$.

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