#P5396. 第二类斯特林数·列
第二类斯特林数·列
Background
Tester’s note: The program running time is greatly affected by judging load, and it may be slowed down during peak times.
Problem Description
The Stirling number of the second kind denotes the number of ways to partition distinct elements into identical non-empty sets.
Given , for every integer , you need to compute .
Since the answer can be very large, you need to output it modulo (, which is a prime).
Input Format
One line with two positive integers , as described above.
Output Format
One line with non-negative integers.
You need to output, in order, the values of $\begin{Bmatrix} 0 \\k \end{Bmatrix}, \begin{Bmatrix} 1 \\k \end{Bmatrix}, \begin{Bmatrix} 2 \\k \end{Bmatrix}, \dots, \begin{Bmatrix} n \\k \end{Bmatrix}$.
3 2
0 0 1 3
Hint
For of the testdata, .
For of the testdata, .
Translated by ChatGPT 5