BFS & DFS
文章平均质量分 83
Yuer-
pku.
展开
-
pds 1112 bfs
- -数据水吧...0S过1112: 最少操作数Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 36 Solved: 28[Submit][Status][Web Board]Description最近,Dr. Kong 又新设计了一个机器人Bill。这台机器人很聪明,会做许多事情。比如你给它任意一原创 2014-02-26 18:35:53 · 603 阅读 · 0 评论 -
poj1753 Flip Game BFS+位运算
http://poj.org/problem?id=17534*4方格的翻转棋,翻转一个,他四周的棋子也都翻转。问最小多少步一方赢。BFS的基本题,有意思的是涉及到了位运算,,,恩恩 ,,灰常神奇!!这里有灰常细致的讲解http://blog.csdn.net/lyy289065406/article/details/6642595 膜拜~//把矩阵看成一个16进制数//原创 2014-02-13 17:52:04 · 652 阅读 · 0 评论 -
poj 3083 DFS+DFS+BFS
http://poj.org/problem?id=3083好久没练搜索了 找了一道搜索综合题- -DFS*2+BFS题目大意:给定一个迷宫,S是起点,E是终点,#是墙不可走,.可以走先输出左转优先时,从S到E的步数再输出右转优先时,从S到E的步数最后输出S到E的最短步数#include #include #include #incl原创 2014-02-18 18:32:37 · 822 阅读 · 0 评论 -
poj1143 DP+dfs+位运算- -
DP+dfs+位运算- -脑袋都大了- -因为一个位运算忘记写 ‘=’ 了 ,用了好久才找到错误!!!!!题目大意:Christine和Matt玩一个游戏.游戏的规则如下:一开始有一列数字(2~20),有的被列出,有的没有列出.从Christine开始,两人轮流划去一个已被列出的数字.每划去一个数字,其他的所有的能被不在这个数列的数字的两两整线性表示的数也自动从数列中退出.到最后,轮原创 2014-02-17 15:03:55 · 519 阅读 · 0 评论 -
困难的串- -(回溯)
如果一个字符串不包含相邻的重复字符子串,就叫做困难的串输入n,l, 输出由前l个字符组成,字典序排第k的串。 1 #include 2 #include string.h> 3 using namespace std; 4 int cnt,n,l; 5 int A[10000]; 6 int dfs(int cur) 7 { 8 if(cnt++==n)原创 2014-01-24 16:36:23 · 972 阅读 · 0 评论 -
poj 1414 life line BFS
一个游戏http://poj.org/problem?id=1414题目大概长成这样Suppose that the turn of the player '4' comes now. If he puts his stone on the vertex shown in Figure 3a, the conditions will be satisfied to remove原创 2014-02-20 19:52:33 · 803 阅读 · 0 评论 -
【DFS】hdu 1175 连连看 stack
http://acm.hdu.edu.cn/showproblem.php?pid=1175连连看Time Limit: 20000/10000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 16171 Accepted Submission(s): 4172原创 2014-03-16 13:20:37 · 667 阅读 · 0 评论 -
ZOJ 3865 Superbot
SuperbotTime Limit: 2 Seconds Memory Limit: 65536 KBSuperbot is an interesting game which you need to control the robot on an N*M grid map.As you see, it's just a simple game: there i原创 2015-04-12 22:27:14 · 568 阅读 · 0 评论