Click here to view the question
After reading the question for a long time, I understood the question for a long time. When I typed a combination, C [I] [J] was wrong .......
This may be the end of the test. Try not to drop too many homework in the first half of the next semester.
The key to this question is true/false, true/false --
There are n people. Some people tell the truth, some people say false things, and everyone knows whether all people say false things or tell the truth. Now ask each of them: the number of people who tell the truth. Everyone will give an answer. AI,
People who say false things will give a random number, but will not give a real answer. Now, I will give you two n k numbers and ask you how many N number solutions are there, we can determine that there are exactly K people lying.
Note the key point: if K has no K people, k people are lying.
Then we start to construct. Suppose there are n vacancies, and we will answer 1 2 3 in sequence .. N people put in these vacancies, set f [I] [J] [k] to 1 ~ J of I members have already been put into the vacant space, and K of them have already been determined to lie,
Next, let's talk about I + 1 people, with N-J vacancies left. Naturally, we need to enumerate the number of people who say I + 1 L, if l = I + 1, we are not sure whether these people are lying or not.
So the transfer is as follows:
If (L = I + 1) f [I + 1] [J + L] [k] = (F [I + 1] [J + L] [k] + F [I] [J] [K] * C [n-J] [l] % mod) % MOD;
Else f [I + 1] [J + L] [K + L] = (F [I + 1] [J + L] [K + L] + F [I] [J] [k] * C [n-J] [l] % mod) % MOD;
The complexity is the fourth power, but n is the exponential power of 2, so let's create a table.
Code