- 博客(3)
- 收藏
- 关注
原创 POJ 2376 Cleaning Shifts
这就是个区间覆盖问题 前端点从小到大排序,后端点排不排都无所谓。 注意一点 p[i].b 这种情况是可以的 也就是说 p[i+1].a 而尾端点是 p[i+1].b > p[i].b; 用两个变量 代表当前区间,不断更新。 l , r p[i].a p[i].b > r r = p[i].b; // Cleaning Shifts.cp
2018-01-16 18:15:30 113
原创 POJ - 2449 K短路
A*+spfa 一张图,找K短路 转自:http://blog.csdn.net/mbxc816/article/details/7197228 “描述一下怎样用启发式搜索来解决K短路。 首先我们知道A*的基础公式:f(x)=g(x)+h(x);对h(x)进行设计,根据定义h(x)为当前的x点到目标点t所需要的实际距离。也就是说x->t距离,由于有很多的节点都是
2018-01-14 00:00:31 184 1
原创 POJ 3253 Fence Repair
#include<cstdio> using namespace std; const int N = 50005; int heap[N],len; void push(int x) { int i; i = ++len; while (i > 1) { if (heap[i / 2] <= x) break; heap[i] = heap[i / 2]; ...
2018-01-10 23:43:55 134
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人