显示代码纯文本
#include<cstdio>
#include<iostream>
using namespace std;
const int SIZEN=110;
int N,ans=0;
class miku
{
public:
int x,y;
}P[SIZEN];
void read()
{
scanf("%d",&N);
for(int i=1;i<=N;i++) scanf("%d%d",&P[i].x,&P[i].y);
}
int det(miku a,miku b,miku c)
{
return (b.x-a.x)*(c.y-a.y)-(c.x-a.x)*(b.y-a.y);
}
int calc(int x,int y)
{
int now=0;
for(int i=1;i<=N;i++)
{
if(i==x||i==y) continue;
if(det(P[i],P[x],P[y])==0) now++;
}
return now;
}
void work()
{
for(int i=1;i<=N;i++)
{
for(int j=i+1;j<=N;j++)
{
if(P[i].x==P[j].x&&P[i].y==P[j].y) continue;
int now=calc(i,j)+2;
ans=max(ans,now);
//if(ans==6) cout<<i<<" "<<j<<endl;
}
}
printf("%d",ans);
}
int main()
{
freopen("asm_fuel.in","r",stdin);
freopen("asm_fuel.out","w",stdout);
read();
work();
return 0;
}