显示代码纯文本
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<cstring>
#include<queue>
#include<ctime>
#include<cstdlib>
using namespace std;
int n=0,ans=0;
int x[110]={},y[110]={};
int a=0,b=0;
long long c=0;
void init(){
cin>>n;
for(int i=1;i<=n;i++)
{
cin>>x[i]>>y[i];
}
}
void work(){
for(int i=1;i<n;i++)
{
for(int j=i+1;j<=n;j++)
{
if(x[i]==x[j] && y[i]==y[j]) continue;
int num=0;
a=y[i]-y[j];
b=x[i]-x[j];
for(int k=1;k<=n;k++)
if(a*(x[k]-x[j])==b*(y[k]-y[j])) num++;
if(num>ans) ans=num;
}
}
cout<<ans<<endl;
}
int main(){
freopen("asm_fuel.in","r",stdin);
freopen("asm_fuel.out","w",stdout);
init();
work();
fclose(stdin);fclose(stdout);
return 0;
}