No.1191 I Want to Love Counting (Sequence Edition)
レベル :
/ AI推定難易度 : 1650
/ 実行時間制限 : 1ケース 2.000秒 / メモリ制限
: 512 MB / 標準ジャッジ問題
タグ : / 解いたユーザー数 115
作問者 :
sanada_atcoder
/ テスター :
Rho
タグ : / 解いたユーザー数 115
作問者 :
sanada_atcoder
/ テスター :
Rho
問題文最終更新日: 2020-08-17 22:30:27
English (AI translation)
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
技術室奥プログラミングコンテスト#5 Day1
(順位表)
の他の問題:
Problem Statement
Find the number of possible sequences $S$ of length $N$ satisfying the following conditions, modulo $998244353$.
Input
$N\ M\ A\ B$
All numbers given in the input are integers.
$2 \le N \le 10^5$
$2 \le M \le 3×10^5$
$1 \le A \le B \le M-1$
Output
Output the remainder when divided by $998244353$. Print a newline at the end.
Sample
Sample 1
Input
2 2 1 1
Output
2
There are 2 such sequences: {$1,2$} and {$2,1$}.
Sample 2
Input
3 5 1 1
Output
0
No sequence satisfies the conditions.
Sample 3
Input
4 19 3 15
Output
11088
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。