Attention:
①注意构造函数、运算符重载的表达
②pow(x,y)是x的y次方
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 210;
struct node{
int id, x, y;
ll d;
node(int id, int x, int y, ll d) : id(id),x(x), y(y), d(d) {}
bool operator < (const node &t) const {
return d == t.d ? id < t.id : d < t.d;
}
};
set<node> q;
int main()
{
int n, X, Y, x, y;
cin >> n >> X >> Y;
for(int i = 1; i <= n; ++i)
{
cin >> x >> y;
ll dist = pow(abs(x - X), 2) + pow(abs(y - Y), 2);
node fresh(i, x, y, dist);
q.emplace(fresh);
}
cout << q.begin()->id << "\n";
q.erase(q.begin());
cout << q.begin()->id << "\n";
q.erase(q.begin());
cout << q.begin()->id;
return 0;
}