Universal Cup Judging System

Universal Cup

Time Limit: 1.5 s Memory Limit: 1024 MB Total points: 100 Hackable ✓
Statistics

För en permutation $p$ av längd $n$ definierar vi $f(p)$ till att representera mängden av positioner för prefixmaximum. Mer specifikt är $f(p) = \{i \mid 1 \le i \le n, \text{ s.t. } \forall 1 \le j < i, p_i > p_j\}$.

På liknande sätt låter vi $g(p)$ representera mängden av talen som utgör prefixmaximum, det vill säga $g(p) = \{p_i \mid i \in f(p)\}$.

Nu väljs $k$ permutationer $p_1, p_2, \ldots, p_k$ oberoende och likformigt slumpmässigt bland alla permutationer av längd $n$ (upprepningar är tillåtna). Little A vill veta hur många väsentligt olika $g(p)$ som förväntas finnas bland dessa permutationer. Målet är att ta reda på det förväntade antalet väsentligt olika mängder bland $g(p_1), g(p_2), \ldots, g(p_k)$. Svaret ska skrivas ut modulo $998244353$.

Indata

En enda rad som innehåller två heltal $n, k$ ($1 \le n, k \le 5000$).

Utdata

En enda rad som innehåller ett heltal som representerar resultatet av svaret modulo $998244353$.

Exempel

Indata 1

1 1

Utdata 1

1

Indata 2

3 2

Utdata 2

388206139

Indata 3

3 4

Utdata 3

408232647

Indata 4

112 646

Utdata 4

928854225

Anmärkning

För det första exemplet är svaret $1$.

För det andra exemplet är svaret $\frac{31}{18}$.

För det tredje exemplet är svaret $\frac{1711}{648}$.

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.