显示代码纯文本
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<queue>
#include<vector>
#include<cstring>
#include<string>
#include<cstdlib>
using namespace std;
struct str{
double x,y;
}a[110];
double k[110];
int w[110],n,ans=0;
int main()
{
freopen("asm_fuel.in","r",stdin);
freopen("asm_fuel.out","w",stdout);
cin>>n;
for(int i=1;i<=n;i++)
{
scanf("%lf%lf",&a[i].x,&a[i].y);
}
for(int i=1;i<=n;i++)
{
k[i]=-2;
for(int j=1;j<=n;j++)
{
if(i!=j)
{
if(a[j].x==a[i].x) k[j]=-1;
else k[j]=(a[j].y-a[i].y)/(a[j].x-a[i].x);
}
}
for(int j=1;j<=n;j++)
{
for(int q=j+1;q<=n;q++)
{
if(k[j]==k[q])
{
w[j]++;
w[q]++;
}
}
}
for(int j=1;j<=n;j++)
{
ans=max(w[j],ans);
}
memset(k,0,sizeof(k));
memset(w,0,sizeof(w));
}
cout<<ans+1;
return 0;
}