[Cqoi2011] playing chess pieces

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.