摘要: 简单题题意:对于一场acm比赛,给出所有提交状况,求排名。注意:提交状况并非按时间顺序。View Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>#include <algorithm>using namespace std;#define maxn 1005#define maxp 25struct Team{ int t, p, id;}team[maxn];struct Sub{ int a, b, c, d;}sub[ma 阅读全文
posted @ 2011-07-24 20:16 undefined2024 阅读(272) 评论(0) 推荐(0)
摘要: 最短路,bellmanView Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>#include <cmath>using namespace std;#define inf 0x3f3f3f3f#define maxn 100#define maxm 10000#define eps 10e-9int n, m, pre[maxn], edge[maxm][2];double d[maxm];double dist[maxn]; 阅读全文
posted @ 2011-07-24 12:19 undefined2024 阅读(197) 评论(0) 推荐(0)
摘要: bfsView Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>using namespace std;#define maxn 8struct Wall{ int s, e; int p; bool h;}wall[5];struct Point{ int x, y;}s, e, q[maxn * maxn];int n = 6;int step[maxn][maxn];int from[maxn][maxn];int dir[4][2] 阅读全文
posted @ 2011-07-24 10:23 undefined2024 阅读(209) 评论(0) 推荐(0)