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

分享WA10次之后AC的经验:

Posted by omllyf at 2009-08-23 12:50:26 on Problem 2826
判断两线段是否相交(此处"相交"的定义是:两条线段存在公共点叫相交,两条线段不存在公共点叫不相交)
不相交输出0.00,否则:
判断两线段是否重合,重合输出0.00,否则:
判断两线段是否斜率都不为零,若两线段中存在某条线段斜率为零输出0.00,否则:
判断豁口是否被遮住,若被遮住输出0.00,否则输出计算答案(这个大家都会算吧).
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
判断豁口是否被遮住的方法:
豁口由两个点来表示(哪两个点都晓得吧!)
判断距离两线段交点较远的那个豁口点(若一样远随便取其中一点)向+Y方向发出的射线是否与两条线段都相交,若都相交则说明豁口被遮住了输出0.00,否则输出计算答案.
此题我所有有关参量都使用double型,未加任何精度控制.

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