Logo
(追記) (追記ここまで)

30359번 - Tea time in the grand garden 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 1024 MB117763.636%

문제

Appropriate temperature changes are essential for brewing delicious tea. Noli has been taught a recipe for delicious tea.

The recipe is represented by a sequence of non-negative integers $A = a_0, a_1, a_2, \dots, a_N, a_{N+1}$ of length $N+2$. She must change the temperature accordingly.

Raising the temperature is hard work. The cost of a recipe $A$ is defined by the following $f(A)$.

$f(A) = \sum_{i=0}^{N}{\max(0, a_{i+1} - a_i)}$

Noli has forgotten the recipe she was taught. All she remembers is that $a_0 = a_{N+1} = 0$ and that the cost was $K$.

How many possible recipes can be considered? Find the remainder of the number of possible recipes divided by 998244353ドル$.

Note that two recipes are different when the values of $a_i$ are different for any $i$ (0ドル \le i \le N+1$).

입력

$N$ $K$

출력

Output the remainder of the number of possible recipes divided by 998244353ドル$. Add a new line at the end of the output.

제한

  • All inputs consist of integers.
  • 1ドル \le N \le 2 \times 10^5$
  • 0ドル \le K \le 2 \times 10^5$

예제 입력 1

2 2

예제 출력 1

5

예제 입력 2

100 0

예제 출력 2

1

예제 입력 3

300 300

예제 출력 3

527212271

예제 입력 4

200000 200000

예제 출력 4

885086300

힌트

In Sample Input 1, There are five possible sequences $A$.

  • $\{0,2,0,0\}$
  • $\{0,0,2,0\}$
  • $\{0,1,2,0\}$
  • $\{0,2,1,0\}$
  • $\{0,2,2,0\}$

출처

Contest > ICPC Japanese Alumni Group > JAG Summer Camp > JAG Summer Camp 2023 Day 2 F번

Camp > Petrozavodsk Programming Camp > Summer 2024 > Day 1: Welcome Contest F번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /