Think of 50%.
F [I] [J] [k] indicates the first I type, which occupies the K column of the J row. Number of solutions.
Found that the transfer should be handled: the number of "using C pawns to occupy n rows of M columns.
Set G [I] [J] [k] to represent the number of K pieces occupied by column J in the I row. Directly deal with complexity explosion.
Then I went to mengbier.
Consider the following:
That is, the total number of solutions-the number of illegal solutions (not completely covered)
G [I] [J] [k] = C (I * j, k)-Σ l Σ R: G [l] [r] [k] * C (I, l) * C (J, R) (I * j> = K & L <= I & J <= r)
Obviously, L and R are different and will not be reduced.
We don't need to count all K. We just need to count the C.
Then the transfer of F [I] [J] [k] is justified.
Complexity: O (N ^ 2 m ^ 2c)
Summary:
I didn't think of this step...
If it is difficult.
The most important thing is that the recursion between K is not needed. Therefore, the third dimension seems to be K, but it is actually C (10)
[Cqoi2011] playing chess pieces