#P6075. [JSOI2015] 子集选取
[JSOI2015] 子集选取
Description
Given a set with elements and an integer , we want to choose some subsets from and arrange them into a triangle with side length as shown below (so in total, subsets are chosen).
$$\begin{matrix} A_{1,1}\\ A_{2,1}&A_{2,2}\\ A_{3,1}&A_{3,2}&A_{3,3}\\ \vdots&\vdots&\vdots&\ddots\\ A_{k,1}&A_{k,2}&A_{k,3}&\cdots&A_{k,k} \end{matrix}$$In addition, JYY has extra requirements on the chosen subsets: these subsets must satisfy and .
JYY wants to know how many different ways there are to choose these subsets. Since the answer is very large, you only need to output the answer modulo .
For two selection plans $A = \left\{ A_{1,1} , A_{2,1} ,\cdots, A_{k,k} \right\}$ and $B = \left\{ B_{1,1} , B_{2,1} ,\cdots, B_{k,k} \right\}$, as long as there exists some such that , we consider and to be different plans.
Input Format
The input contains one line with two integers and .
Output Format
Output one line with one integer, representing the number of different plans modulo .
2 2
16
Hint
For of the testdata, .
Translated by ChatGPT 5
京公网安备 11011102002149号