| ||||||||||
| 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 | |||||||||
题目意思题目意思:
给定一些点,问最多有多少个点在一条直线上
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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator