28 analog solution to a problem

A. Tiger

Compare obviously greedy.

Even number does not meet the conditions exist sons, all directly linked.

There is an odd number, the last remaining one can upload the upload, otherwise killed here.

Easy to prove, the more the situation does not meet the conditions of the upload, the answer does not make better.

 

 

 

 

B. yin and yang

Title two properties were observed:

  1. 0/1 block Unicom
  2. No No 1 between peers with 1, i.e., between the left and right sides respectively 0/1 columns 0,0.

Combining found legitimate program must be distributed in a rectangular four corners 1.

Manually discuss inclusion and exclusion would be finished.

  1. Choose a corner, violence does not drop sequence dp
  2. Option two adjacent corners, find out about the decision interval of each line, intersected size.
  3. Pick two opposite corners, special sentenced to 0/1 full feasibility.
  4. Option three corners, above.
  5. Option four corners, above.

 

 

 

C. cave

60 minutes, $ (nm) O $ direct violence dp.

Consider optimization.
O (n ^ 2) processing the transfer matrix.

Obviously transition matrix is ​​a matrix cycle.

Optimization of matrix m-, then m% n dp force on it.

 

Guess you like

Origin www.cnblogs.com/skyh/p/11391409.html