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

WA了的有可能是这种情况:

Posted by 20181gdgzoi236 at 2019-07-05 08:11:12 on Problem 3335
bool onright(Point a,Line l)
{
    return compare(cross(l.t-l.s,a-l.s),0)>0?0:1;
}

要改为

bool onright(Point a,Line l)
{
    return compare(cross(l.t-l.s,a-l.s),0)>=0?0:1;
}
/*
compare(a,b):如果a<b return -1;如果a=b return 0;如果a>b return 1。
cross(a,b):Point a、b的叉乘
*/

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