//目录
摘要: 题目链接:http://poj.org/problem?id=2259 水题一个,就是要记录一下每个队列是否有人bool[i], #include <iostream> #include <string> #include <queue> #include <map> #include <cstdi 阅读全文
posted @ 2016-05-11 21:59 小草的大树梦 阅读(273) 评论(0) 推荐(0)
摘要: 题目链接:http://poj.org/problem?id=2082 把矩形按照高度一次递增的循序排列,当违反这一规则的时候,更新ans,用新的data替换之前的矩形。然后最后扫一遍。 #include <iostream> #include <stack> #include <cstdio> u 阅读全文
posted @ 2016-05-11 21:07 小草的大树梦 阅读(496) 评论(0) 推荐(0)
摘要: sort()函数的cmp为函数,priority_queue的cmp为类,具体写法是: #include <iostream> #include <queue> using namespace std; typedef struct { int id;///用户ID int time;///下一次出 阅读全文
posted @ 2016-05-11 20:35 小草的大树梦 阅读(1134) 评论(0) 推荐(0)
摘要: 题目链接:http://poj.org/problem?id=2051 ///维持最小堆(优先队列)POJ2051 #include <iostream> #include <string> using namespace std; struct Node { int Now; ///出堆的时间 i 阅读全文
posted @ 2016-05-11 20:18 小草的大树梦 阅读(495) 评论(0) 推荐(0)
摘要: #define MAX_HEAP_LEN 100 static int heap[MAX_HEAP_LEN]; static int heap_size = 0; ///堆中的元素个数 static void swap (int *a,int *b) { int temp=*a; *a=*b; *b 阅读全文
posted @ 2016-05-11 18:51 小草的大树梦 阅读(272) 评论(0) 推荐(0)