上一页 1 ··· 143 144 145 146 147 148 149 150 151 ··· 182 下一页
摘要: 最短路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)
摘要: 简单题View Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>#include <algorithm>using namespace std;#define maxn 100005int n, m, f[maxn];int main(){ //freopen("t.txt", "r", stdin); scanf("%d", &n); for (int i = 阅读全文
posted @ 2011-05-24 21:21 undefined2024 阅读(204) 评论(0) 推荐(0)
摘要: 简单题打表, 打了之后的程序发布上来……View Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>using namespace std;int cal(int a, int b, int c){ return (a * b + b * c + c * a) * 2;}int work(int a){ int ans = 1000000000; for (int i = 1; i * i * i <= a; i++) for (int 阅读全文
posted @ 2011-05-24 20:03 undefined2024 阅读(175) 评论(0) 推荐(0)
上一页 1 ··· 143 144 145 146 147 148 149 150 151 ··· 182 下一页