maximum number of dominoes can be placed inside a figure

后端 未结 2 1181
别跟我提以往
别跟我提以往 2020-12-16 01:31

Suppose some figure on the squared paper. Sides of the figure go straight on the lines of squared paper. Figure may have any (not even convex) shape. How to find the maximum

2条回答
  •  醉话见心
    2020-12-16 02:24

    You can classify squares by the number of neighbor free squares as type 0, 1, 2, 3 or 4.

    I believe that should work:

    1. find a type 1 square, place there a domino in the only possible way and repeat

    2. else, find a free corner formed by two contiguous type 2 and type 3 squares, place there a domino and go to 1

    3. else, place a domino in any type 2 square and go to 1

    4. you are done

提交回复
热议问题