2012年7月9日

POJ 2632 模拟题

摘要: 模拟题,不是很恶心。算法:1.写好各种操作函数Turn_Left, Turn_Right, Forward2.处理好各种细节,我wa,主要是由机器编号求其坐标时搞错,还有Turn是没有注意次数。View Code #include<iostream>#include<string.h>#include<stdlib.h>#include<stdio.h>using namespace std;int T, A, B, N, M, maxn;int mp[110][110]; //存储机器人位置,值0表示该坐标无机器人,1表示方向E,2表示S,3表 阅读全文

posted @ 2012-07-09 21:25 more think, more gains 阅读(167) 评论(0) 推荐(0) 编辑

poj 1068 模拟题

摘要: 模拟题:算法1.由输入的P-sequence构找S2.根据S求每个右括号的左匹配括号,pipei[right] = left3.根据W-sequence定义求结果View Code #include <stdio.h>#include <string.h>#include <stdlib.h>#include <iostream>#include <stack>using namespace std;int p[10000], N;char stk[100000];int pipei[10000];int pre( ){ int x 阅读全文

posted @ 2012-07-09 16:57 more think, more gains 阅读(126) 评论(0) 推荐(0) 编辑

POJ 1328 贪心

摘要: 算法:1.求出覆盖该岛的圆得区间, 將问题转换为求过出最少得点,保证每个区间至少有一个点。2.按区间的左端排序3.更新radView Code #include <stdio.h>#include <iostream>#include <stdlib.h>#include <string.h>#include <algorithm>#include <math.h>using namespace std;struct node{ double x, y; bool operator < (const node& 阅读全文

posted @ 2012-07-09 10:36 more think, more gains 阅读(139) 评论(0) 推荐(0) 编辑

导航