![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
DFS
Wang_SF2015
这个作者很懒,什么都没留下…
展开
-
文章标题 POj 1321:棋盘问题(DFS)
棋盘问题Description在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。 Input输入含有多组测试数据。 每组数据的第一行是两个正整数,n k,用一个空格隔开,表示了将在一个n*n的矩阵内描述棋盘,以及摆放棋子的数目。 n <= 8 ,原创 2016-08-04 08:51:46 · 376 阅读 · 0 评论 -
文章标题 HDU 5113 : Black And White (dfs+剪枝)
Black And WhiteDescriptionIn mathematics, the four color theorem, or the four color map theorem, states that, given any separation of a plane into contiguous regions, producing a figure called a map, n原创 2016-09-22 22:47:49 · 388 阅读 · 0 评论 -
文章标题 UVALive 6432 Influence(dfs)
InfluenceIn any society there are social influence relations between individuals, where a person x can influence another person y. The same is true for Softopia, a special society where social influenc原创 2016-09-07 20:09:11 · 298 阅读 · 0 评论 -
文章标题 POJ 1753 : Flip Game(枚举+dfs)
Flip GameDescriptionFlip game is played on a rectangular 4x4 field with two-sided pieces placed on each of its 16 squares. One side of each piece is white and the other one is black and each piece is l原创 2016-10-30 18:45:43 · 458 阅读 · 0 评论 -
文章标题 POJ 2965 : The Pilots Brothers' refrigerator(枚举+dfs)
The Pilots Brothers’ refrigeratorDescriptionThe game “The Pilots Brothers: following the stripy elephant” has a quest where a player needs to open a refrigerator.There are 16 handles on the refrigerato原创 2016-10-30 20:12:32 · 81 阅读 · 0 评论 -
文章标题 POJ 1426 :Find The Multiple (dfs)
Find The MultipleGiven a positive integer n, write a program to find out a nonzero multiple m of n whose decimal representation contains only the digits 0 and 1. You may assume that n is not greater th原创 2016-12-11 17:21:36 · 215 阅读 · 0 评论 -
文章标题 HDU 1455 : Sticks(dfs+剪枝)
SticksDescription George took sticks of the same length and cut them randomly until all parts became at most 50 units long. Now he wants to return sticks to the original state, but he forgot how many原创 2016-11-24 22:27:42 · 320 阅读 · 0 评论 -
文章标题 HDU 2553 : N皇后问题 (DFS)
N皇后问题在N*N的方格棋盘放置了N个皇后,使得它们不相互攻击(即任意2个皇后不允许处在同一排,同一列,也不允许处在与棋盘边框成45角的斜线上。 你的任务是,对于给定的N,求出有多少种合法的放置方法。 Input 共有若干行,每行一个正整数N≤10,表示棋盘和皇后的数量;如果N=0,表示结束。 Output 共有若干行,每行一个正整数,表示对应输入行的皇后的不同放置数量。 Sample原创 2017-01-08 22:48:59 · 279 阅读 · 0 评论 -
文章标题 HDU 1016 : Prime Ring Problem (DFS)
Prime Ring ProblemA 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:原创 2017-01-08 23:38:00 · 248 阅读 · 0 评论