Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:确实是道水题,我发个完整精确版的线段位置关系判定给大家留作模板吧

Posted by Brad_jz at 2016-02-14 16:29:51 on Problem 1410 and last updated at 2016-02-14 16:46:04
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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator