CodeBus
www.codebus.net
Search
Sign in
Sign up
Hot Search :
Source
embeded
web
remote control
p2p
game
More...
Location :
Home
Search - chess board detect
Main Category
SourceCode
Documents
Books
WEB Code
Develop Tools
Other resource
Sub Category
Shot Game
Game Server Simulator
Chess Poker games
Game Engine
Other Riddle games
Mobile games
Other Games
Search - chess board detect - List
[
Game Program
]
N huanghou
DL : 0
国际象棋中皇后可以在横、竖、斜线上不限步数地吃掉其他棋子。如何将N个皇后放在一个国际象棋的棋盘上(有8 * 8个方格),使它们谁也不能被吃掉!这就是著名的八皇后问题。我们现在扩展一下,对于某个满足要求的N皇后的摆放方法,定义一个皇后序列与之对应,即{(x1,y1),(x2,y2)…(xN,yN)},其中(xi∈[1,N],yi∈[1,N],N∈[4,16]),其中(xi,yi)为相应摆法中第i个皇后所处的坐标(行数和列数)。那么需要针对这个序列进行检测,检测序列给定的皇后们是否存在可以相互吃掉的情况。(In chess, the queen can eat other pieces on the horizontal, vertical and oblique lines. How to put N empress on a chess board (8 * 8 squares), so that none of them can be eaten. This is the famous eight queen problem. Let's expand now, and define a queen's sequence corresponding to the placement method of a N queen to meet the requirements, that is, {(x1, Y1), (X2, Y2). (xN, yN)}, where (Xi, [1, N], Yi, [1, N], N [4,16]), (Xi, Xi) is the coordinate (row number and column number) of the queen in the corresponding pendulum. Then we need to detect this sequence to detect whether the Queens given by the sequence can eat each other.)
Date
: 2026-01-09
Size
: 5kb
User
:
youxiaoyu
CodeBus
is one of the largest source code repositories on the Internet!
Contact us :
1999-2046
CodeBus
All Rights Reserved.