上一页 1 ··· 140 141 142 143 144 145 146 147 148 ··· 182 下一页
摘要: 简单题View Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>using namespace std;#define maxn 27char pre[maxn], in[maxn], post[maxn];int len;int find(int l, int r, char ch){ for (int i = l; i < r; i++) if (in[i] == ch) return i; return -1;}void make 阅读全文
posted @ 2011-05-29 19:11 undefined2024 阅读(407) 评论(1) 推荐(0)
摘要: 简单题View Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>using namespace std;#define maxn 35struct Point{ int x, y, z;} s, e;int dir[6][3] ={{ 1, 0, 0 },{ -1, 0, 0 },{ 0, 1, 0 },{ 0, -1, 0 },{ 0, 0, 1 },{ 0, 0, -1 } };bool map[maxn][maxn][maxn];int 阅读全文
posted @ 2011-05-29 18:52 undefined2024 阅读(443) 评论(0) 推荐(0)
摘要: 简单题View Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>using namespace std;int com(int n, int r){ if (n - r < r) r = n - r; int i , j; long long s = 1; for (i = 0, j = 1; i < r; i++) { s *=(n - i); for (; j <= r && s % j == 0; j+ 阅读全文
posted @ 2011-05-29 17:22 undefined2024 阅读(189) 评论(0) 推荐(0)
摘要: 迭代加深搜索View Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>using namespace std;#define maxn 105#define maxq 10005int n, ans[maxn][maxn];int len[maxn];int seq[maxn];int d;void dfs(int a){ if (a > d) return; for (int i = 0; i < a; i++) for (in 阅读全文
posted @ 2011-05-29 17:08 undefined2024 阅读(333) 评论(0) 推荐(0)
摘要: 匈牙利,二分图匹配View Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>using namespace std;#define maxn 305struct Edge{ int v, next;} edge[maxn * 7 * 12];int n, m;int head[maxn];int xM[maxn], yM[maxn];bool chk[maxn];int count;void addedge(int a, int b){ ed 阅读全文
posted @ 2011-05-29 15:58 undefined2024 阅读(259) 评论(0) 推荐(0)
上一页 1 ··· 140 141 142 143 144 145 146 147 148 ··· 182 下一页