시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
2 초 | 512 MB | 11 | 11 | 10 | 100.000% |
Consider $S$, the sequence of integer sequences. Initially, $S_0 = (1)$. After that, we construct $S_1, S_2, \ldots, S_n$ as follows.
Let $|S_i|$ be the length of the sequence $S_i$, and $s_{i,j}$ be the $j$-th element of $S_i$. Then $S_{i+1}$ will have length $|S_i|+1$ and can be obtained from $|S_i|$ using one of the following two operations:
Given $n$ and $m$, find the number of different ordered sets of sequences $S_1 \ldots S_n$. Two sets are considered different if, at least for one $i$ from $1$ to $n$, the sequences $S_i$ in those sets differ. As the answer may be too large, print it modulo $998\,244\,353$.
The input consists of one line containing two integers $n$ and $m$ ($1 \le n \le 3000$, $2 \le m \le 10^8$).
Print the number of different sequences $S$ modulo $998\,244\,353$.
2 3
5
1024 52689658
654836147
Here are the possible sequences in the first example:
Therefore, the answer is $5$.