DP plug explain + [BZOJ1814]: Ural 1519 Formula 1 (plug DP)

1. What is the plug DP?

CDQ Gangster plug DP is proposed in the 2008 paper, is used is based on a more advanced form of pressure DP DP multi- processing Unicom issues ( routing problem, a simple loop problems , multi-loop problems, generalized loop problems, spanning tree problem).

DP plug each question is different, and requires a more complicated classification discussions, so DP plug to exercise very strict and comprehensive thinking.


2. Plug DP ideas

  $ \ Mathcal {A.} $ Envision

    $ \ Alpha. $ Plugs

      Plug shows a link state .

      In the board model, the plug has a grid in a certain direction, indicating that the grid is connected with the plug in this direction side of the grid.

      Note: The plug is not to say the virtual state of going somewhere, but has arrived somewhere in reality state .

      Next we need to consider is where to go, because if there is a plug points to the current grid, indicating that the current grid and China Unicom have been the source of the plug.

      With the plug on the convenience much more attractive, we generally need a frame-by-recursive, popular talk, it is to run again.

    $ \ Beta. $ Contours

      Contour line is the line of demarcation, as to why it is called contour lines, I do not know, like why the CDQ called CDQ, she did not know, but her parents know.

      You can emotional be understood as a "decision-making has been a lattice" and "no decision grid" dividing line.

      However, the use of more than that of the contour line.

      Contour also compatible plug status on this line memory effect.

      Note that there are m grid, then there will be m + 1 plugs assumptions within his party, and why?

      Look at this chart below:

      

      Obviously there are four grid within his party, but there are five plug right out of the lattice of more than a plug that is currently in decision-making.

      Personal habits plug No. 1 ~ m.

      General data range is relatively small, we can use like pressure to store, i.e. the definition dp [i] [j] [state] represents the current decision to the (i, j) at this point, the status of the program number $ State $ (or price, etc).

    $ \ Chi. Combined $ plugs with contour

      Plug in conjunction with contour lines together, it will crash out some beautiful spark.

      We recursion, it is the basis for the existence of the plug to obtain all can be transferred to a legitimate state.

      In the circuit in question, a grid for a state exactly two plugs, a "come in", a "Get out."

  $ \ Mathcal {B}. $ Recording state

    Here are three ways to introduce a recording state:

    $ \ Alpha. $ Minimum representation

      For convenience, all obstacles lattice as 0, the first lattice disorder as well as all non-grid connected to it is marked as 1, the first unlabeled adjacent to it, and the lattice grid is marked as 2 ......

      Repeat the process until all the grid are marked complete.

      For chestnut:

        1,2,5 Unicom, Unicom 3,6, 4 themselves and their cards together, it is the minimum notation {1,1,2,3,1,2}.

    $ \ Beta. $ Bracket notation

      A first look nature: a contour hypothesis plugs 4 a, b, c, d, a and b and c does not Unicom Unicom, then b and d certainly not Unicom.

      This property is important because it applies to all of the chessboard .

      

      Like this, it is clear also if the intersection of b and d, then it is impossible to meet the situation.

      A little more specific:

      

      I believe careful you will find that the path to the top of the profile are disjoint from the path consisting of several pieces, the reason is again on top of that picture.

      Two endpoints on each path also corresponds exactly to the contour of the two plugs .

      Digress, this "do not cross" very easy for us to think of matching parentheses, brackets into the stack left and right parentheses Stack, left parenthesis must correspond to the closing parenthesis.

      Of course, it is possible to make you think Cartland number, it is very important to help you card often.

    $ \ Chi. Coding state $

      利用状压的思想,我们将每行m+1个状态用一个m+1位的k进制数表示,在做题的时候建议将k改为2的n次幂,方便进行为运算,运行速度会有很大的提升(前提空间允许)。

      小技巧:如需大范围修改联通状态,可以选择

Guess you like

Origin www.cnblogs.com/wzc521/p/11260885.html
DP