上一页 1 ··· 99 100 101 102 103 104 105 106 107 ··· 182 下一页
摘要: 最短路,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)
摘要: 简单题View Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>using namespace std;#define maxn 25#define maxm 105char irr1[maxn][maxm], irr2[maxn][maxm];char st[maxm];int n, m;int getid(){ for (int i = 0; i < n; i++) if (strcmp(st, irr1[i]) == 0) ret 阅读全文
posted @ 2011-07-23 19:44 undefined2024 阅读(157) 评论(0) 推荐(0)
摘要: 简单题View Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>using namespace std;#define maxn 20int f[maxn];int n, ans;void input(){ ans = 0; getchar(); for (int i = 0; i < n; i++) { f[i] = 0; for (int j = 0; j < 25; j++) { char ch = getchar(); i 阅读全文
posted @ 2011-07-23 19:29 undefined2024 阅读(395) 评论(0) 推荐(0)
摘要: dp利用单调双向队列。类似sliding windows。View Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>using namespace std;#define maxn 260struct Node{ int pos, a; Node() { } Node(int pp, int aa) : pos(pp), a(aa) { }} q[maxn];int n, sub, m;int f[maxn][maxn], fmax[maxn 阅读全文
posted @ 2011-07-23 17:08 undefined2024 阅读(553) 评论(0) 推荐(0)
上一页 1 ··· 99 100 101 102 103 104 105 106 107 ··· 182 下一页