Codeforces Round #609 (DIV 2) D. Domino for Young

Topic Link

I understand the problem solution.

Assertion: The necessary and sufficient conditions for Young diagram can be filled with the domino is: after Young staining pattern board, the number of black and white squares of the same.

Obviously, this condition is necessary, it is sufficient to prove the following.

We used to represent the height of each column of a Young diagram.

A method is described domino filled with the following Young FIG.

See Young each column from right to left in FIG. For convenience of description, the right-most column called that first column, first row of the left column of the row is called a second, and so on. If the following step by step in a Young diagram is deleted empty stopped.

  1. If the height of the first row is even, put it removed. Examples: 54322 became 543. If the height of the first column is an odd number, put this column portions other than the bottom of that piece removed. Examples: 543 into 541
  2. At this first column height is 1, if the first two height is odd, will be able to put these columns are filled and delete, go back to step 1. Example: 5 531 becomes. When the height of the second column is an even number, put the second column to delete only the two lowermost grid, go to step 3. Examples: 541 into 521.
  3. When the height of the height of parity and the second row third column of the same, and put it down to the same height of the second column, then the height of the second and third columns are reduced to 1, then the first column and the second column deleted. Step 2 of rotation.

  4. .....

As described above, and finally deleted Young FIG either empty or becomes shaped like $ k, k - 1, \ dots, 2, 1 $, and the number of such black and white squares in FIG Young must not equal. This means that if the initial Young chart after an equal number of black and white checkerboard dyed plaid, then it must be filled. So far it proved the assertion.

Young FIG reset input of the board after staining with a black grid $ B $ and $ $ W is a white squares. Obviously, the number of dominoes can fill no more than $ \ min (B, W) $. Can be shown, you will be able to fill $ \ min (B, W) $ th dominoes.

The following proof: the form $ k, k - 1, \ dots, 2, 1 $ satisfy the condition of Young FIG.

0
-----------
0
1 0
-----------
0
1 0
0 1 0
-----------

0 represents white image above the grid, a grid for black. We always put the top left corner of the grid dyed white, this is better than black and white squares grid and more. For $ k $ by induction. Provided $ k = n $ Conclusion satisfied, $ k = n + 1 $ than $ k = n $ when a plurality lowermost grid row, this row of the grid is black and white and the right-most lattice It is white, so that each row in the grid can find a dark adjacent paired with white squares.

Guess you like

Origin www.cnblogs.com/Patt/p/12081794.html