随笔分类 -  最短路径

Only valuable things here!
sicily 1321 Robot(Dijkstra)
摘要:给出一个矩阵表示经过没一点时耗费的油量,且在当前的点可以向上下左右四个方向移动,问从起点(start_r,start_c)到终点(end_r,end_c)所耗费的最小油量。鉴于个人水平,第一想到的就是Dijkstra算法求最短路径。并且没有使用二叉堆维护当前最小权值,效率较低。#includeiostream#includevector#includestdio.h#includecstringusing namespace std;struct Edge{ int v; int cost; Edge(int vv,int cc): v(vv),cost(cc) {}};con 阅读全文
posted @ 2010-12-24 10:20 c++fans 阅读(1043) 评论(0) 推荐(1)