posts - 0,comments - 0,trackbacks - 0
lz,想问下G题。
怎么证明对于Li,Xi只取-Li或者Li就能保证取到最小值。?
thx。
re: 数论中的一些公式(转) joy32812 2010-04-06 13:49
顶!
re: 旋转卡壳算法 poj2187 poj3608 joy32812 2010-02-28 23:35
//计算凸包直径,输入凸包ch,顶点个数为n,按逆时针排列,输出直径的平方
int rotating_calipers(Point *ch,int n)
{
int q=1,ans=0;
ch[n]=ch[0];
for(int p=0;p<n;p++)
{
while(cross(ch[p+1],ch[q+1],ch[p])>cross(ch[p+1],ch[q],ch[p]))
q=(q+1)%n;
ans=max(ans,max(dist2(ch[p],ch[q]),dist2(ch[p+1],ch[q+1])));
}
return ans;
}
*************************************************
想问下LZ,这段代码中cross部分的面积比较;
有可能出现面积为负的情况吧。。
为什么不是fabs(cross())呢??(我测试下,加上fabs是错误的)
谢~~
re: 旋转卡壳算法 poj2187 poj3608 joy32812 2010-02-28 21:25
写的灰常好,受教了!!
顶LZ!