#include#include #include using namespace std; int n, a, b, x, y, d; vector > ds; bool ju(vector a, vector 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 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; }
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)