摘要:
最长上升子序列View Code #include <iostream>#include <cstdlib>#include <cstdio>#include <cstring>#include <algorithm>using namespace std;#define maxn 100005int n;int top;int stk[maxn];int binarysearch(int l, int r, int a){ if (l > r) return l; if (a > stk[r]) return r + 1 阅读全文
posted @ 2012-10-23 18:50
undefined2024
阅读(240)
评论(0)
推荐(0)
摘要:
简单题View Code #include <iostream>#include <cstdlib>#include <cstdio>#include <cstring>using namespace std;#define maxn 105char st1[maxn], st2[maxn];int main(){ while (true) { scanf("%s", st1); scanf("%s", st2); if (st1[0] == 'E') break; int p1, p2; 阅读全文
posted @ 2012-10-23 17:02
undefined2024
阅读(140)
评论(0)
推荐(0)
摘要:
简单题View Code #include <iostream>#include <cstdlib>#include <cstdio>#include <cstring>using namespace std;int n;int main(){ int t = 0; while (scanf("%d", &n) && n) { t++; printf("%d. ", t); if (n & 1) printf("odd "); else printf(&q 阅读全文
posted @ 2012-10-23 16:54
undefined2024
阅读(119)
评论(0)
推荐(0)
摘要:
模拟利用pick公式area=on/2+in-1计算in的时候从外围广搜所有不是in的点,再用总数减去。View Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>#include <algorithm>using namespace std;#define maxn 150struct Point{ int x, y;} q[maxn * maxn];char map[maxn][maxn];int n, m;bool vis[m 阅读全文
posted @ 2012-10-23 16:33
undefined2024
阅读(197)
评论(0)
推荐(0)