摘要: A 水题。B 计算几何求重心,枚举对称点。#include #include #include #include #include using namespace std;#define maxn 600#define eps 1e-6bool zero(double a) {return (fabs(a)eps){ t=barycenter(p[0],p[i],p[i+1]); ret.x+=t.x*t2; ret.y+=t.y*t2; t1+=t2; } } if(fabs(t... 阅读全文
posted @ 2013-10-06 15:13 fangguo 阅读(201) 评论(0) 推荐(0) 编辑
摘要: 思路:先O(n)预处理出ri[i][j],le[i][j],分别表示第i个位置向右边移动出j个空格需要的步数,表示第i个位置向左边移动出j个空格需要的步数。然后枚举间隙处,二分判段最大间隔。#include#include#include#include#define Maxn 710#define inf 100000000using namespace std;int ri[Maxn][Maxn],le[Maxn][Maxn],n,m;char str[Maxn];bool OK(int pos,int x){ int i,j,cnt=inf; if(pos==1) { ... 阅读全文
posted @ 2013-10-06 15:05 fangguo 阅读(271) 评论(0) 推荐(1) 编辑