#include <iostream>
#include<vector>
#include<algorithm>
using namespace std;
int n, a, b, x, y, d;
vector<vector<int>> ds;
bool ju(vector<int> a, vector<int> b) {
if (a[1] == b[1]) return a[0] < b[0];
return a[1] < b[1];
}
int main() {
int index = 1;
while (cin >> n) {
cin >> x >> y;
while (n--) {
cin >> a >> b;
d = (x - a) * (x - a) + (y - b) * (y - b);
vector<int> t;
t.push_back(index++);
t.push_back(d);
ds.push_back(t);
}
break;
}
sort(ds.begin(),ds.end(),ju);
cout << ds[0][0] << endl << ds[1][0] << endl << ds[2][0];
return 0;
}
【练习记录】 202009-1 称检测点查询
最新推荐文章于 2024-09-15 11:40:06 发布