随笔分类 - 搜——索--dfs
摘要:Curling 2.0 Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 21605 Accepted: 8799 Description On Planet MM-21, after their Olympic games thi
阅读全文
摘要:在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。 Input 输入含有多组测试数据。 每组数据的第一行是两个正整数,n k,用一个空格隔开,表示了将
阅读全文
摘要:Leo has a grid with N rows and M columns. All cells are painted with either black or white initially. Two cells A and B are called connected if they s
阅读全文
摘要:The Worm Turns Problem Description Winston the Worm just woke up in a fresh rectangular patch of earth. The rectangular patch is divided into cells, a
阅读全文
摘要:N皇后问题 Problem Description 在N*N的方格棋盘放置了N个皇后,使得它们不相互攻击(即任意2个皇后不允许处在同一排,同一列,也不允许处在与棋盘边框成45角的斜线上。你的任务是,对于给定的N,求出有多少种合法的放置方法。 Input 共有若干行,每行一个正整数N≤10,表示棋盘和
阅读全文
摘要:符号三角形 Problem Description 符号三角形的 第1行有n个由“+”和”-“组成的符号 ,以后每行符号比上行少1个,2个同号下面是”+“,2个异 号下面是”-“ 。计算有多少个不同的符号三角形,使其所含”+“ 和”-“ 的个数相同 。 n=7时的1个符号三角形如下:+ + - +
阅读全文
摘要:Sudoku Killer Problem Description 自从2006年3月10日至11日的首届数独世界锦标赛以后,数独这项游戏越来越受到人们的喜爱和重视。据说,在2008北京奥运会上,会将数独列为一个单独的项目进行比赛,冠军将有可能获得的一份巨大的奖品———HDU免费七日游外加lcy亲笔
阅读全文
摘要:Prime Ring Problem Problem Description A ring is compose of n circles as shown in diagram. Put natural number 1, 2, ..., n into each circle separately
阅读全文
摘要:Red and Black Problem Description There is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing
阅读全文
摘要:Mr. Frog’s Game Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 312 Accepted Submission(s): 209 P
阅读全文