QOJ.ac

QOJ

Time Limit: 2 s Memory Limit: 256 MB Total points: 100

#1603. 被 EI 加 0 了

統計

给定 $n,m$ 。

求有多少个不同的正整数序列 $a_1,a_2,\dots,a_n$ ,使得对任意 $1\leq i\leq n$ 有 $1\leq a_i\leq m$ 且不存在 $1\leq i < j\leq n$ 满足 $\max\limits_{k=1}^i a_k=\min\limits_{k=j}^n a_k$ ,对 $998244353$ 取模。

输入格式

第一行一个正整数 $T$ ,代表测试组数。

接下来 $T$ 行,每行包含两个正整数 $n,m$ 。

输出格式

$T$ 行,每行一个正整数,代表这组数据的答案,对 $998244353$ 取模。

样例数据

样例输入

3
3 2
3 3
4 10

样例输出

2
12
7500

子任务

对于 $50\%$ 的数据,保证 $n\le 50$。

对于 $100\%$ 的数据,保证 $1\le T\le 10^5, 1\le n\le 300, 1\le m \le 10^9$。

About Issues

We understand that our problem archive is not perfect. If you find any issues with the problem, including the statement, scoring configuration, time/memory limits, test cases, etc.

You may use this form to submit an issue regarding the problem. A problem moderator will review your issue and proceed it properly.

STOP! Before you submit an issue, please READ the following guidelines:

  1. This is not a place to publish a discussion, editorial, or requests to debug your code. Your issue will only be visible by you and problem moderators. Other users will not be able to view or reply your issues.
  2. Do not submit duplicated issues. If you have already submitted one, please wait for an moderator to review it. Submitting multiple issues will not speed up the review process and might cause your account to be banned.
  3. Issues must be filed in English or Chinese only.
  4. Be sure your issue is related to this problem. If you need to submit an issue regarding another problem, contest, category, etc., you should submit it to the corresponding page.

Active Issues 0

No issues in this category.

Closed/Resolved Issues 0

No issues in this category.