![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
DFS
leihao-lester
这个作者很懒,什么都没留下…
展开
-
Avoid The Lakes
Avoid The Lakes Farmer John’s farm was flooded in the most recent storm, a fact only aggravated by the information that his cows are deathly afraid of water. His insurance agency will only repay him, ...原创 2019-11-28 15:53:47 · 119 阅读 · 0 评论 -
迷宫问题
迷宫问题 定义一个二维数组: int maze[5][5] = { 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, }; 它表示一个迷宫,其中的1表示墙壁,0表示可以走的路,只能横着走或竖着走,不能斜着走,要求编程序找出从左上角到右下角的最短路线。 Input 一个5 × 5的二维数...原创 2019-11-28 15:05:12 · 97 阅读 · 0 评论 -
Red and Black
Red and Black There is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile. From a tile, he can move to one of four adjacent tile...原创 2019-11-28 14:52:56 · 195 阅读 · 0 评论 -
Prime Ring Problem
Prime Ring Problem A ring is compose of n circles as shown in diagram. Put natural number 1, 2, …, n into each circle separately, and the sum of numbers in two adjacent circles should be a prime. Note...原创 2019-11-28 14:26:55 · 150 阅读 · 0 评论 -
N皇后问题
title: N皇后 tags: thumbnail: keywords: N皇后问题 在N*N的方格棋盘放置了N个皇后,使得它们不相互攻击(即任意2个皇后不允许处在同一排,同一列,也不允许处在与棋盘边框成45角的斜线上。) 你的任务是,对于给定的N,求出有多少种合法的放置方法。 Input 共有若干行,每行一个正整数N≤10,表示棋盘和皇后的数量;如果N=0,表示结束。 Output 共有若...原创 2019-11-27 22:58:37 · 171 阅读 · 0 评论