显示代码纯文本
#include<iostream>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<string>
#include<algorithm>
using namespace std;
const int maxn=150;
const int delta=10005;
int n;
int x[maxn];
int y[maxn];
int maxx=-1;
int main()
{
freopen("asm_fuel.in","r",stdin);
freopen("asm_fuel.out","w",stdout);
scanf("%d",&n);
for(int i=1;i<=n;i++)
{
scanf("%d %d",&x[i],&y[i]);
}
for(int i=1;i<=n;i++)
{
for(int j=i+1;j<=n;j++)
{
if(x[i]!=x[j]||y[i]!=y[j])
{
int cnt=0;
for(int k=1;k<=n;k++)
{
int x1=x[k]-x[i],y1=y[k]-y[i],x2=x[k]-x[j],y2=y[k]-y[j];
if(x1*y2==x2*y1)
cnt++;
}
maxx=max(cnt,maxx);
}
}
}
cout<<maxx;
}