2013年12月16日

HDU1115

摘要: 写的很好的求重心的文章 转载下下 URAL:http://www.cnblogs.com/try86/archive/2012/04/21/2462458.html主要是求HDU1115 阅读全文

posted @ 2013-12-16 21:28 forgot93 阅读(60) 评论(0) 推荐(0) 编辑

判断线段是否相交

摘要: 1 double mul(node a,node b,node c)//c叉积运算 2 { 3 return (b.x-a.x)*(c.y-a.y)-(b.y-a.y)*(c.x-a.x); 4 } 5 int judge(node a,node b,node c,node d)//判断线段两个点是否在一条线段的两端,要对两条线段都判断 6 { 7 double p1=mul(a,c,b); 8 double p2=mul(a,d,b); 9 if (p1*p2<=0&&!(p1==0&&p2==0)) return 1;//这里有题目可能两条线段重合,所 阅读全文

posted @ 2013-12-16 16:30 forgot93 阅读(145) 评论(0) 推荐(0) 编辑

导航