![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
***Dijkstra(迪杰斯特拉)算法***
文章平均质量分 68
zm_11
这个作者很懒,什么都没留下…
展开
-
Hdu oj 2544 最短路
题目:点击打开链接 代码一:Dijkstra算法模版 void dijkstra(int s) { for(int i=1;i<=N;i++) { d[i]=INF; used[i]=false; } d[s]=0; while(true) { int v=-1; for(原创 2015-08-17 17:32:05 · 466 阅读 · 0 评论 -
Hdu oj 1869 六度分离
题目:点击打开链接 代码: #include #include #define INF 0x3f3f3f3f using namespace std; int m,n; int cost[110][110],d[110]; bool used[110]; void distr(int x) { for(int i=0;i<m;i++) { d[i]=INF;原创 2015-08-18 10:19:58 · 660 阅读 · 0 评论 -
Hdu oj 1874 畅通工程续
题目:点击打开链接 #include #include #define INF 0x3f3f3f3f using namespace std; bool used[210]; int cost[210][210],d[210]; int m,n; int o,p; void dijkstra(int x) { for(int i=0;i<m;i++) { d[原创 2015-08-17 20:47:55 · 486 阅读 · 0 评论 -
Hdu oj 2066 一个人的旅行
题目:点击打开链接 代码: #include #include #define INF 0x3f3f3f3f using namespace std; int a1[1010]; int b1[1010]; int cost[1010][1010],d[1010]; bool used[1010]; int m,n,p; void distr(int x) { for(原创 2015-08-18 11:15:27 · 666 阅读 · 0 评论 -
Hdu oj 2112 HDU Today
题目:点击打开链接 关于C++中map的使用:点击打开链接 代码: #include #include #include #include//将字符串转化成数字 #include #define INF 0x3f3f3f3f using namespace std; char str1[30],str2[30]; int cost[150][150],d[150]; bo原创 2015-08-18 16:31:55 · 566 阅读 · 2 评论 -
Hdu oj 1596 find the safest road
题目:点击打开链接 分析:审清题,注意格式。 代码 #include #include #include using namespace std; double cost[1010][1010],d[1010]; bool used[1010]; int t; void distr(int x,int y) { for(int i=1;i<=t;i++) {原创 2015-08-18 21:26:18 · 365 阅读 · 0 评论 -
Hdu Oj 2680 Choose the best route
题目:点击打开链接 代码: #include #include #define INF 0x3f3f3f3f using namespace std; int cost[1010][1010],d[1010]; bool used[1010]; int a,b,c; void distr(int x) { for(int i=1;i<=a;i++) { d[i]=原创 2015-08-19 10:01:01 · 531 阅读 · 0 评论