#P10596. BZOJ2839 集合计数
BZOJ2839 集合计数
Background
This problem comes from the original BZOJ. We acknowledge that the copyright of the statement and the original testdata belongs to the original BZOJ or the problem setter who authorized the problem for BZOJ. If you are the copyright owner and believe that we have infringed your rights, please contact us.
Problem Description
A set with elements has different subsets (including the empty set). Now, we want to choose some subsets from these subsets (at least one subset), such that the number of elements in their intersection is . Find the number of ways to choose them. Output the answer modulo .
Input Format
One line containing two integers .
Output Format
One line containing one integer, representing the answer.
3 2
6
Hint
Sample Explanation
Suppose the original set is . Then the valid selections are: , , , , , .
Constraints
For of the testdata, , .
Translated by ChatGPT 5