上一页 1 ··· 81 82 83 84 85 86 87 88 89 ··· 182 下一页
摘要: 二维树状数组View Code #include <iostream>#include <cstdlib>#include <cstring>#include <cstdio>using namespace std;#define maxn 1030int c[maxn][maxn];int Row, Col, n;inline int Lowbit(const int &x){ return x & (-x);}int Sum(int i, int j){ int tempj, sum = 0; while (i > 0) 阅读全文
posted @ 2011-08-31 09:07 undefined2024 阅读(261) 评论(0) 推荐(0)
摘要: pairs的组合只可能是3+3或者3+4所以其余长度的单词无需记录把记录后的单词n^2枚举pairView Code #include <iostream>#include <cstdlib>#include <cstring>#include <cstdio>using namespace std;char pre1[30] = "qwertyuiopasdfghjklzxcvbnm";int pre2[30] ={ 7, 6, 1, 2, 2, 5, 4, 1, 3, 5, 2, 1, 4, 6, 5, 5, 7, 6, 阅读全文
posted @ 2011-08-29 20:26 undefined2024 阅读(294) 评论(0) 推荐(0)
摘要: 深搜简单题View Code #include <iostream>#include <cstdlib>#include <cstring>#include <cstdio>using namespace std;#define maxn 25int n, m;char map[maxn][maxn];bool vis[30];int ans;int dir[4][2] ={{ 0, 1 },{ 1, 0 },{ -1, 0 },{ 0, -1 } };bool ok(int x, int y){ if (x < 0 || y < 0 阅读全文
posted @ 2011-08-29 19:23 undefined2024 阅读(288) 评论(0) 推荐(0)
摘要: 简单题View Code #include <iostream>#include <cstdlib>#include <cstring>#include <cstdio>using namespace std;int value[300];char st[1000000];bool ok(int n){ int len = strlen(st); for (int i = 0; i < len; i++) if (value[st[i]] >= n) return false; int temp = 0; int w = n - 1; 阅读全文
posted @ 2011-08-29 18:58 undefined2024 阅读(273) 评论(0) 推荐(0)
摘要: 求割点模板:void dfs(int fa, int u){ low[u] = dfn[u] = cnt++; for (int i = 0; i < n; i++) if (g[u][i] && i != fa) { if (dfn[i] == -1) { dfs(u, i); low[u] = min(low[i], low[u]); if (dfn[u] <= low[i]) i... 阅读全文
posted @ 2011-08-29 15:27 undefined2024 阅读(152) 评论(0) 推荐(0)
上一页 1 ··· 81 82 83 84 85 86 87 88 89 ··· 182 下一页