![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
dfs
nucleare
这个作者很懒,什么都没留下…
展开
-
A - 棋盘问题
A - 棋盘问题 在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。Input输入含有多组测试数据。 每组数据的第一行是两个正整数,n k,用一个空格隔开,表示了将在一个n*n的矩阵内描述棋盘,以及摆放棋子的数目。 n <= 8 , k <...原创 2018-04-02 20:48:01 · 277 阅读 · 0 评论 -
K - 迷宫问题
K - 迷宫问题 定义一个二维数组: 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 × ...原创 2018-04-24 21:55:11 · 323 阅读 · 0 评论 -
D - 棋盘问题 (dfs经典题)poj1321
在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。Input输入含有多组测试数据。 每组数据的第一行是两个正整数,n k,用一个空格隔开,表示了将在一个n*n的矩阵内描述棋盘,以及摆放棋子的数目。 n <= 8 , k <= n 当为-1...原创 2018-05-22 21:40:03 · 836 阅读 · 0 评论 -
A - A Knight's Journey (poj2488)(dfs经典)
A Knight's JourneyTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 27258 Accepted: 9295DescriptionBackground The knight is getting bored of seeing the same black and white squares again and a...原创 2018-05-23 21:37:32 · 202 阅读 · 0 评论 -
C - Curling 2.0 (dfs)
On Planet MM-21, after their Olympic games this year, curling is getting popular. But the rules are somewhat different from ours. The game is played on an ice game board on which a square mesh is mark...原创 2018-05-28 20:55:26 · 203 阅读 · 0 评论 -
B - Children of the Candy Corn(双dfs+bfs)
The cornfield maze is a popular Halloween treat. Visitors are shown the entrance and must wander through the maze facing zombies, chainsaw-wielding psychopaths, hippies, and other terrors on their que...原创 2018-05-24 21:10:25 · 143 阅读 · 0 评论 -
Zipper OpenJ_Bailian - 2192 (记忆化搜索)
Given three strings, you are to determine whether the third string can be formed by combining the characters in the first two strings. The first two strings can be mixed arbitrarily, but each must sta...原创 2018-07-24 20:26:48 · 208 阅读 · 0 评论 -
Werewolf HDU - 6370 (dfs )
Werewolf HDU - 6370 "The Werewolves" is a popular card game among young people.In the basic game, there are 2 different groups: the werewolves and the villagers. Each player will debate a player ...原创 2018-12-03 19:57:12 · 181 阅读 · 0 评论