POJ3254 Corn Fields status compression DP

Source: Internet
Author: User

POJ3254 Corn Fields status compression DP

 

I feel a little similar. I started to brush questions because the CF game was abused. Let's review the questions from the simplest point. The details are very poor. Alas

 

The DP equation is somewhat different from the general one. dp [I] [j] indicates how many types of data are placed in row j under state I, then the total number is the sum of dp [I] [n-1], which is pushed down based on the first behavior boundary. The Boundary Value of the first line is 1, because the current status is of course a method from the beginning of the first line, but the source image itself can not be put in some places, it is annoying to solve it together at the beginning, after looking at other people's ideas, it seems that the source image is legal and illegal. It seems that I am too young, so the next step is very clear. Of course, it is also a state to say that every row is not put, I missed it at the beginning, and I thought the case was wrong. I watched the equation for half a year.

 

 

# Define MOD limit int n, m, cnt; int mp [15]; int aa [1 <15]; int dp [1 <15] [15]; void init () {memset (mp, 0, sizeof (mp); memset (dp, 0, sizeof (dp); memset (aa, 0, sizeof (aa);} bool input () {while (scanf (% d, & n, & m) = 2) {for (int I = 0; I

 

  

 

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.