开发者

How to fill the chessboard with domino? [closed]

开发者_如何学C It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago.

How we can to fill the chessboard with domino and we have a some blocks. and chessboard is n x m. and the places filled with ordered numbers.

Test :

How to fill the chessboard with domino? [closed]

Answer like this :

How to fill the chessboard with domino? [closed]

input give n , m and k. k is number of blocks. and next k lines give blocks such as 6 7 or 4 9.

sorry for my English.


Here's an idea. In your example board, it is immediately obvious that squares 7 9 and 14 must contain domino 'ends', that is to say it must be the case that there are dominos covering 2-7, 8-9, and 14-15.

(In case it's not 'immediately obvious', the rule I used is that a square with 'walls' on three sides dictates the orientation of the domino covering that square)

If we place those three dominos, it may then be the case that there are more squares to which the same rule now applies (eg 20).

By iterating this process, we can certainly make progress towards our goal, or alternatively get to a place where we know it can't be achieved.

See how far that gets you.

edit also, note that in your example, the lower-left corner 2x2 (squares 11 12 16 17) is not uniquely determined - a 90 degree rotation of the depicted arrangement would also work - so you will have to consider such situations. If you are looking for any solution, you must come up with a way of arbitrarily picking one of many possibilities; if you are trying to enumerate all possibilities, you will have to come up with a way of finding them all!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜