摘要: 简单题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 阅读(158) 评论(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)
摘要: 简单题View Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>#include <algorithm>using namespace std;#define maxn 30char order[maxn];char st[maxn];int l;void work(char ch){ char x; int d; switch (ch) { case 'J': x = st[l - 1]; for (int i 阅读全文
posted @ 2011-07-23 09:41 undefined2024 阅读(176) 评论(0) 推荐(0)
摘要: 简单题View Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>using namespace std;#define maxn 1005int f[maxn];int n;bool vis[maxn];int gcd(int x, int y){ if (!x || !y) return x > y ? x : y; for (int t; t = x %y; x = y, y = t); return y;}int main(){ 阅读全文
posted @ 2011-07-23 08:46 undefined2024 阅读(207) 评论(0) 推荐(0)