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