| ||||||||||
| 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 | |||||||||
WA了的有可能是这种情况: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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator