称检测点查询
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/375c728cafe8b4ec5198dfe57b3e4953.png)
#include<bits/stdc++.h>
using namespace std;
struct Jiance{
int number;
int distance;
}jian[1001];
bool cmp(Jiance a,Jiance b){
if(a.distance != b.distance){
return a.distance < b.distance;
}
else return a.number < b.number;
}
int main(){
int n,x,y;
cin>>n>>x>>y;
int a[n+1][2] ={0};
for(int i = 1; i <= n; i++){
cin>>a[i][0]>>a[i][1];
}
for(int i = 1; i <= n;i++){
int dis = (x -a[i][0] )*(x-a[i][0])+(y-a[i][1])*(y-a[i][1]);
jian[i].number = i;
jian[i].distance = dis;
}
sort(jian+1,jian+n+1,cmp);
/*for(int i = 1; i <= n; i++){
cout<<jian[i].distance<<" "<<jian[i].number<<endl;
}*/
for(int i = 1; i <= 3;i++){
cout<<jian[i].number<<endl;
}
}