***Dijkstra(迪杰斯特拉)算法***
文章平均质量分 67
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 · 515 阅读 · 0 评论 -
Hdu oj 1869 六度分离
题目:点击打开链接代码:#include#include#define INF 0x3f3f3f3fusing 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 · 719 阅读 · 0 评论 -
Hdu oj 1874 畅通工程续
题目:点击打开链接#include#include#define INF 0x3f3f3f3fusing 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 · 540 阅读 · 0 评论 -
Hdu oj 2066 一个人的旅行
题目:点击打开链接代码:#include#include#define INF 0x3f3f3f3fusing 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 · 727 阅读 · 0 评论 -
Hdu oj 2112 HDU Today
题目:点击打开链接关于C++中map的使用:点击打开链接代码:#include#include#include#include//将字符串转化成数字 #include#define INF 0x3f3f3f3fusing namespace std;char str1[30],str2[30];int cost[150][150],d[150];bo原创 2015-08-18 16:31:55 · 634 阅读 · 2 评论 -
Hdu oj 1596 find the safest road
题目:点击打开链接分析:审清题,注意格式。代码#include#include#includeusing 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 · 417 阅读 · 0 评论 -
Hdu Oj 2680 Choose the best route
题目:点击打开链接代码:#include#include#define INF 0x3f3f3f3fusing 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 · 580 阅读 · 0 评论
分享