摘要:
最短路View Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>#include <queue>using namespace std;#define V 1005#define E 5005#define inf 0x3f3f3f3f;int cost[E], dist[V];int e, pnt[E], nxt[E], head[V], prev[V], vis[V];int n, m;struct qnode{ int v, 阅读全文
posted @ 2011-05-25 09:51
undefined2024
阅读(356)
评论(0)
推荐(0)
摘要:
简单题View Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>#include <queue>using namespace std;#define maxn 106struct XPoint{ int x; int y; XPoint(int xx, int yy) : x(xx), y(yy) { } XPoint() { }};int n, m;bool map[maxn][maxn];bool vis[maxn][max 阅读全文
posted @ 2011-05-25 09:23
undefined2024
阅读(473)
评论(0)
推荐(0)
摘要:
最大生成树,注意边数组开二倍大小。注意不连通输出-1;View Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>#include <queue>using namespace std;#define maxn 1005#define maxm 20005struct Edge{ int v, next, w; Edge(int vv, int nn, int ww) : v(vv), next(nn), w(ww) { } Edg 阅读全文
posted @ 2011-05-25 09:03
undefined2024
阅读(303)
评论(0)
推荐(0)