HDOJ5107 K-short Problem

前天晚上的best coder的题。 数据太弱暴力都放过去了,而且还是错的。当然我也太naive了TT。 我没管k<=10,直接硬上树状数组套平衡树,用二分搞的。然后数组开小了不开心啊。 #include <cstdio> #include <cmath> #include <cctype> #include <algorithm> #include <set> #include <memory.h> using namespace std; struct query { int x, y, k, n; }; struct tower { int x, y, h; }; inline bool cmpTower(const tower& a, const tower& b) { return a. x < b. x; } inline bool cmpQuery(const query& a, const query& b) { return a. x < b. x; } inline bool cmpP(int* a, int* b) {...

November 17, 2014 · 3 min · laekov