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

题目意思

Posted by ecjtuQX at 2008-09-26 20:48:30 on Problem 2606
题目意思:
给定一些点,问最多有多少个点在一条直线上
ans=0;
		for(i=1;i<=n;i++)
		{
			m=0;
			for(j=1;j<=n;j++)
				if(i!=j)
					a[++m]=Angle(p[i],p[j]);
			sort(a+1,a+1+m);
			max=1;
			for(k=2;k<=m;k++)
			{
				if(same(a[k-1],a[k]))
					max++;
				else
					max=1;
				if(max>ans)
					ans=max;
			}
		} 

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