上一页 1 2 3 4 5 6 7 8 9 10 ··· 15 下一页
摘要: 第一个部分 前4题 次小生成树算法:首先如果生成了最小生成树,那么这些树上的所有的边都进行标记。标记为树边。接下来进行枚举,枚举任意一条不在MST上的边,如果加入这条边,那么肯定会在这棵树上形成一个环,如果还要维护处树的特点那么就要在这个环上删去一条边,这样他还是树,删掉的边显然是这条链上权值最大边... 阅读全文
posted @ 2015-10-27 21:17 Commence 阅读(371) 评论(0) 推荐(0) 编辑
摘要: 整套题都没什么难度、POJ 1251 Jungle Roads#include #include #include #include #include #include #include #include #include #include #include #include #include #i... 阅读全文
posted @ 2015-10-24 18:17 Commence 阅读(182) 评论(0) 推荐(0) 编辑
摘要: 做这套题之前一直以为并查集是很简单的数据结构。做了才发现自己理解太不深刻。只看重片面的合并集合。。重要的时发现每个集合的点与这个根的关系,这个关系可以做太多事情了。题解:POJ 2236 Wireless Network10S时限,尽量做到最优吧。一开始还怕会T预处理出能到达的点。简单题看代码就行了... 阅读全文
posted @ 2015-10-22 20:45 Commence 阅读(391) 评论(0) 推荐(0) 编辑
摘要: 求一个图最短路边的办法。好像下面的那个有问题。单向边和双向边一定是有区别的。这个比较容易。参照该文的最短路网络流题目和连通图题目一题求最短路关节边 另外上述2个题目的代码好像有问题。 在UVALIVE 6885中不能得到AC。不知道原因。感觉是对的。 另一种判断最短路的方法就是 从起点到u+从终点到 阅读全文
posted @ 2015-10-19 20:45 Commence 阅读(703) 评论(0) 推荐(0) 编辑
摘要: 2份模板 DC3 。 空间复杂度O3N 时间复杂度On#define F(x) ((x) / 3 + ((x) % 3 == 1 ? 0 : tb))#define G(x) ((x) = 0 ; i--) b[--wsd[wv[i]]] = a[i];}void dc3(int *r,int *s... 阅读全文
posted @ 2015-10-17 20:46 Commence 阅读(480) 评论(0) 推荐(0) 编辑
摘要: HDU 1166 敌兵布阵 单调更新区间查询和 #include <map> #include <set> #include <list> #include <cmath> #include <ctime> #include <deque> #include <stack> #include <qu 阅读全文
posted @ 2015-10-14 13:43 Commence 阅读(432) 评论(0) 推荐(0) 编辑
摘要: 题意很简单,说是裸的线段树。然而我觉得十分有难度。。。。首先第一步:将所有数值看作是ax+b的形式。对于乘操作 变成kax+kb,对于加操作变成ax+b+c;第二步操作顺序:因为操作顺序会影响答案(一开始还想每个区间维护一个queue结果在TLE和MLE之间徘徊)首先最优的一定是设置为一个值set操... 阅读全文
posted @ 2015-10-12 13:10 Commence 阅读(254) 评论(0) 推荐(0) 编辑
摘要: 刷题之前来几套LCA的末班对于题目HDU 2586How far away2份在线模板第一份倍增,倍增还是比较好理解的#include #include #include #include #include #include #include #include #include #include #... 阅读全文
posted @ 2015-10-08 13:11 Commence 阅读(280) 评论(0) 推荐(0) 编辑
摘要: 学习资料: http://www.cnblogs.com/grenet/p/3145800.htmlhttp://blog.csdn.net/mu399/article/details/76278622份模版 第一份精确覆盖 from POJ 3074const int N = 9;const in... 阅读全文
posted @ 2015-10-06 22:29 Commence 阅读(378) 评论(0) 推荐(0) 编辑
摘要: 所有代码:UVALIVE 4043 Ants#include #include #include #include #include #include #include #include #include #include #include #include #include #include #i... 阅读全文
posted @ 2015-09-12 13:28 Commence 阅读(190) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 15 下一页