csp-s analog 80 (b)

Noon exam the first time, a look at three topics come up that the board is three, but one look at the range of data on the right.

T1:

  Exam on the idea is: Find circulation section for circulating section is not in an array in one, the maintenance of a number in ascending sequence ending / beginning of the cycle for just a portion of the intermediate take the same value.

  The sample can be too large, but in fact WA, did not consider the case of rising circulation section. This split point occurs LIS is $ $ section length of the cyclic number == loop section, so the $ len \ times len $ cycle length section included in the head / tail processing.

  Positive Solutions of matrix multiplication can be done on the $ dp $ cycling section.

T2:

  The items have been thinking about binary multiplication into $ N \ times 64 $ or $ N \ times C $ two items, then just run $ M $ secondary channel maximum flow, thinking life difficult also thought to play.

  This question $ dp $ good idea. For problem: determine whether a natural number $ N $ (wherein L is limited to be greater than $ $) is composed of $ W $. We can consider under the conditions of a congruence resolved, namely: no one can make up for the $ W_0 $, plus a number of provisions of $ V_0 $, will be able to form a new number. We require this number is the smallest item $ V $, then the judge can make up $ W $, only need to determine the $ W \% V_0 $ can be composed of. Thus design condition: $ f [i] [j] [k] $ I $ denotes Before considering the number of $, $ L greater than the selected number of $ $ $ J a, there $ S \% V_0 == k $ of minimum $ S $. If finally there is the minimum of $ S $ $ smaller than the required $ W, will be able to make up $ W $.

  TRANSITION: If the current $ V [i]> = L $, $ f [i] [j] [k] = \ min (f [i-1] [j] [k], f [i-1] [ j-1] [kV [i]] + V [i]) $, directly $ \ Theta (1) $ transfer, a total of $ \ Theta (N * C * W) $; otherwise, $ f [i] [ j] [k] = \ min (f [i-1] [j] [k], f [i-1] [j] [kV [i]] + V [i]) $, found in the same layer $ J $, transfer ring, for this transfer to take $ min / max $, consider FIG built shortest run / long way to solve the overall $ \ Theta (N * C * W * log W) $.

T3:

  It intended that part of the $ 60pts $ points, but 20 points less Internet sentenced error.

  Consider a black dot for each $ x $ join contribution brings. First, the answer in its sub-tree may be updated by $ $ w [x]. For each $ x $ fathers, brothers and other sub-tree where $ x $ can be updated accordingly ancestry $ w $, and no units sub tree produced only contribution to the brothers for the first time to add black o'clock. $ Dfn $ sequence, the maximum segment tree maintenance.

Guess you like

Origin www.cnblogs.com/Duan-Yue/p/11710148.html