题目大意
思路
代码
#include<bits/stdc++.h>
using namespace std;
int i,j,k,l,n,m,f[2005],g[2005];
struct op
{
int x,y;
}s[100001];
struct ex
{
int a,b;
long long len;
}w[4000005];
bool cmp(ex x,ex y)
{
return x.len<y.len;
}
int main()
{
cin>>n;
for (i=1;i<=n;i++)
{
cin>>s[i].x>>s[i].y;
w[++m].a=i;w[m].b=0;w[m].len=s[i].x*s[i].x+s[i].y*s[i].y;
}
for (i=1;i<=n;i++)
for (j=1;j<=n;j++)
if (i!=j){
w[++m].a=i;w[m].b=j;
w[m].len=(s[i].x-s[j].x)*(s[i].x-s[j].x)+(s[i].y-s[j].y)*(s[i].y-s[j].y);
}
sort(w+1,w+m+1,cmp);
for (i=1;i<=m;i=j)
{
j=i;
while (j<=m&&w[i].len==w[j].len) j++;
for (k=i;k<j;k++) f[w[k].b]=max(g[w[k].a]+1,f[w[k].b]);
for (k=i;k<j;k++) g[w[k].b]=max(g[w[k].b],f[w[k].b]);
}
cout<<g[0];
}