HDU 4666 Hyperspace【最远曼哈顿距离+优先队列】
摘要:
这个题是动态的求最远曼哈顿距离。做法和POJ 2926 Requirements一样,都是通过二进制枚举符号的情况。每插入一个节点都要询问最大值和最小值,因此用一个优先队列或者堆维护就可以了。 #include #include #include #include #include using namespace std;#define N 60010#define inf 0x3fffffffint q, k, a[5];bool vis[N];struct node1 { int x, id; bool operator a.x; }}t2;priority_queue ... 阅读全文
posted @ 2013-08-14 18:54 bbsno 阅读(258) 评论(0) 推荐(0)