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:搜索最远点的时候应该这样写才能AC!

Posted by 20111595 at 2012-05-15 18:36:52 on Problem 3384
In Reply To:搜索最远点的时候应该这样写才能AC! Posted by:POJ_Cyx at 2011-01-11 19:31:52
> 注释部分是WA的
> 	double maxdis=0;
> 	int maxi=0,maxj=0;
> 	/*for (int i=1;i<=poly.n-1;i++)
> 	{
> 		for (int j=i+1;j<=poly.n;j++)
> 		{
> 			double tdis=dis(poly.p[i],poly.p[j]);
> 			if (tdis>=maxdis)
> 			{
> 				maxdis=tdis; maxi=i; maxj=j;
> 			}
> 		}
> 	}*/
> 	for (int i=1;i<=poly.n;i++)
> 	{
> 		for (int j=1;j<=poly.n;j++)
> 		{
> 			if (i==j) continue;
> 			if (double_cmp(dis(poly.p[i],poly.p[j])-maxdis)>=0)
> 			{
> 				maxdis=dis(poly.p[i],poly.p[j]);
> 				maxi=i; maxj=j;
> 			}
> 		}
> 	}
> 

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