Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Re:确实是道水题,我发个完整精确版的线段位置关系判定给大家留作模板吧In Reply To:确实是道水题,我发个完整精确版的线段位置关系判定给大家留作模板吧 Posted by:hzauxiaoze at 2014-08-05 22:17:37 这模板不太对吧,比如a(1, 1) b(3, 1) c(2, 1) d(4, 1),结果应该是重叠共线也就是-3,但测试结果是-1。貌似把 if(min(a.x,b.x)<max(c.x,d.x)&&min(c.x,d.x)<max(a.x,b.x)&&min(a.y,b.y)<max(c.y,d.y)&&min(c.y,d.y)<max(a.y,b.y)) return -3; //重叠共线 这一句里面的小于号全部改成小于等于号就可以了,不太确定。 Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator