csp-s Analog 90

T1:

Opacity of each cell is equivalent to a right side, the maximum conversion of all paths from the start to the end. Longest road, preferably with a $ dijk $.

T2:

For $ N = 100 $, $ M = 8 $, consider shaped pressure $ dp $. Use one state rectangle representing a line of coverage, in fact, need only concern rectangle endpoint. With eight quaternary, on each $ 1 $ for this grid is a rectangular left point, right point $ 2 $, $ 3 $ both left and right end point, not an endpoint $ 0 $. When the transfer state of the next line enumeration for the next line of each rectangle, $ $ 1 if it does not take on one line is generated. The number of states rarely consider the limiting case of a line $ 8 $ a $ 1 $, find the final state only whether a bit alone in a rectangular shape about (state $ 3 $), not rectangular alone is certain synthetic large rectangle adjacent to the (state $ 002 $ 100 ...), i.e. $ 01 $ string can be turned into consideration, a total state $ 8 $ ^ 2. For the state of each row may be pretreated $ $ DFS. Overall complexity $ \ Theta (N * M * 2 ^ {2 * M}) $.

T3:

$30pts$:

Order processing operation, whether the inquiry, rectangular front storm sweep, under the determination, the left boundary intersection point, taking the maximum of the minimum rectangle in the coordinate reference. $ \ Theta (N ^ 2) $ ..

$60pts$:

Coordinates of the small range, each cell may be stored reference made rectangular boundary. $ $ X per challenge by small to large, from small to large $ Y $, to give the corresponding point on the boundary is determined whether a fall point. Note that the processing where $ x $ a = 0, may be treated individually.

$100pts$:

Consider the contribution of each rectangle to the inquiry, it was found that it updates the slope for a range of answers. Discrete slope. Under separate consideration, right boundary, maintenance answer to each slope (minimum coordinate priority, followed by the maximum number), the segment tree section changes a single point of inquiry. The two final borders, the answer was transformed into $ x $ or $ y $ compared.

Guess you like

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