![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
搜索
疯的世界
这个作者很懒,什么都没留下…
展开
-
poj_2230 Watchcow
WatchcowTime Limit: 3000MSMemory Limit: 65536KTotal Submissions: 4550Accepted: 1898Special Judge题目链接:http://poj.org/problem?id=2230DescriptionBe原创 2012-08-01 23:39:21 · 618 阅读 · 0 评论 -
A*算法
在看下面这篇文章之前,先介绍几个理论知识,有助于理解A*算法。启发式搜索:启发式搜索就是在状态空间中的搜索对每一个搜索的位置进行评估,得到最好的位置,再从这个位置进行搜索直到目标。这样可以省略大量无畏的搜索路径,提到了效率。在启发式搜索中,对位置的估价是十分重要的。采用了不同的估价可以有不同的效果。估价函数:从当前节点移动到目标节点的预估费用;这个估计就是启发式的。在寻路问题和迷宫问题转载 2012-08-17 15:13:38 · 1119 阅读 · 0 评论 -
深搜 广搜
#include#include#include#define maxvertex 100using namespace std;//邻接表存储图的遍历——深搜和广搜struct graph{ //起点终点权值 int vertex[maxvertex];//存顶点 int arc[maxvertex][maxvertex];//存表(邻接矩阵) i原创 2013-04-03 11:15:58 · 1044 阅读 · 0 评论 -
斐波拉契数列 优化
#include using namespace std;long a[1000];//斐波拉契数列long fib(int n){ if(n<=1) return n; if(a[n]!=0)return a[n];//将已经计算过得值存放起来 return a[n] = fib(n-1)+fib(n-2);}int main(){原创 2013-03-27 10:39:30 · 992 阅读 · 0 评论 -
poj_3984 迷宫问题
迷宫问题Time Limit: 1000MSMemory Limit: 65536KTotal Submissions: 4812Accepted: 2737 题目链接:http://poj.org/problem?id=3984 Description原创 2012-07-27 16:18:35 · 1265 阅读 · 0 评论