题目链接: Finding Hotels Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 102400/102400 K (Java/Others) Problem Description There are N hotels all over the world. Each hotel has a location and a price. M guests want to find a hotel with an accept…
STL里面的nth_element()函数 用法:nth_element(first,nth,last) int a[maxn]; nth_element(a,a+k,a+f); 作用:在a到a+f区间内,使第k位左边的都比它小,右边的都比它大. kdtree代码: #include<bits/stdc++.h> #define fi first #define se second #define INF 0x3f3f3f3f #define fio ios::sync_with_stdio(…
KD-tree **了这道题 这个估价函数好鬼畜,把min打成max... 关于min的估价函数非常鬼畜,具体我也不知道为什么. #include<bits/stdc++.h> using namespace std; ; int n, d, root, ans = 2e9, mx, mn; struct data { int x, y, mxx, mnx, mny, mxy, lc, rc; bool friend operator < (const data &a, cons…