CSP试题回顾202009-1 检测点查询(优化)
发布时间
阅读量:
阅读量
解题代码实现
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
struct MyDistance
{
long long index, distance;
};
bool cmp(MyDistance& a, MyDistance& b) {
if (a.distance == b.distance) return a.index < b.index;
return a.distance < b.distance;
}
long long n, X, Y, x, y;
int main() {
cin >> n >> X >> Y;
vector<MyDistance>list(n);
for (size_t i = 0; i < n; i++)
{
cin >> x >> y;
list[i].index =
全部评论 (0)
还没有任何评论哟~
