
Graph Theory - Shortest Path
welcome_z
天地转,光阴迫。一万年太久,只争朝夕。
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
hdu 1879 再水~
#include #include const int N = 10010;using namespace std;struct node{ int u, v, w, c; bool operator < (const node &cmp) const { if (c==cmp.c) return (w<cmp.w); else if (c==1) return原创 2012-07-25 18:57:27 · 604 阅读 · 0 评论 -
hdu 2544 spfa 模板
#include #include #include #include #define clr(x, k) memset((x), (k), sizeof(x))#define MAXe 10002 //e;#define MAXn 210#define INF 1<<30using namespace std;struct Edge{ int to, w, next;}e原创 2012-07-25 17:31:17 · 1103 阅读 · 0 评论 -
hdu 1875 水过~
#include #include #include #define dis(x, y, u, v) sqrt((x-u)*(x-u) +(v-y)*(v-y))const int N = 10010;using namespace std;struct node{ int u, v; double w; bool operator < (const node &cmp)原创 2012-07-25 18:40:13 · 663 阅读 · 0 评论 -
hdu 3790 最短路spfa模板
#include #include #include #include #define clr(x, k) memset((x), (k), sizeof(x))#define MAXe 1000002 //e;#define MAXn 1210#define INF 1<<30using namespace std;struct Edge{ int to, w, p, ne原创 2012-08-12 13:13:55 · 595 阅读 · 0 评论 -
hdu 2952 dfs|bfs|union-find sets
dfs:#include using namespace std;short d[4][2] = {1,0,0,1,-1,0,0,-1};char g[110][110];int n, m, ans;void dfs(int i, int j){ g[i][j] = '.'; for (int k=0;k<4;++k) { int x = i +原创 2012-09-01 23:19:02 · 775 阅读 · 0 评论