#P5748. 集合划分计数
集合划分计数
Description
Given a set with elements, split it into any number of non-empty subsets, and find the number of possible ways.
Note that the resulting subsets are unordered. That is, and are considered the same partition.
Since the answer may be very large, output it modulo .
Input Format
The first line contains a positive integer , which indicates the number of test cases.
The next lines each contain a positive integer .
Output Format
Output lines, each containing one integer representing the answer.
5
2
3
7
9
233
2
5
877
21147
53753544
Hint
Constraints
, .
Sample Explanation
For , there are five ways: $\{\{1,2,3\}\},\{\{1,2\},\{3\}\},\{\{1\},\{2,3\}\},\{\{1\},\{2\},\{3\}\},\{\{1,3\},\{2\}\}$.
This problem has only one test point. Suppose you answer test cases correctly, you will get points.
If you cannot solve all the test cases, please still output integers.
Do not blame me for TLE. Your constant factor is too large.
Translated by ChatGPT 5
京公网安备 11011102002149号