分治纲
文章平均质量分 83
Friedrich_Taylor
Weeping may remain for a night,but joy comes in the morning
展开
-
树分治poj1741
虽然树分治的题目不多,但还是会考的。 树分治的优点在于能够较快处理树与路径的关系,而且复杂度也比较优秀(Olog2n2) 但是太TM难写了...... 下面是一个经典问题:(POJ1741) 给定一棵有n个顶点的树,第i边连ui,vi,长度为wi 统计最短距离不超过k的点对数 思路:对于一个点,分三种情况: (1)两点在不同子树 (2)两点在同一子树 (3)一点在子树,另一原创 2017-03-28 20:13:19 · 355 阅读 · 0 评论 -
zjoi2007 捉迷藏(感谢huanghongxun)
直接贴代码,解释都在注释里#include #include #include #include #include #include #include #include #include #include #include using namespace std; struct heap { priority_queue h, d; void add(int x){ h.pu转载 2017-03-28 21:11:17 · 511 阅读 · 0 评论 -
9.4联合作战战果
1.处理内容 二分图相关 2题 树剖 2题 Floyd 1题 2-SAT 1题 最小生成树 1题 tarjan 1题 点分治 1题 模拟 1题 2.二分图 首先是比较简单的二分图判定 (1)双栈排序(NOIP2008提高组) 题面见链接https://www.luogu.org/problem/show?pid=1155 分析:考虑在什么情况下两数不能同栈 在通过原创 2017-09-04 21:31:24 · 281 阅读 · 0 评论 -
9.7联合作战战果
1.处理内容 数据结构部 线段树 1题 树状数组 1题 数学几何部 凸包 1题 旋转卡壳 1题 半平面交 1题 几何基础 1题 皮克定理 1题 平面分治 1题 2.数据结构 (1)线段树练习3 区间修改http://codevs.cn/problem/1082/ #include #include #include #include #include #include原创 2017-09-07 19:57:00 · 300 阅读 · 0 评论 -
9.11第一轮扫荡战果
1.处理内容 图论部 hall定理 1题 最小生成树 1题 动态规划部 简单线性DP 1题 非经典DP 1题 数学几何部 博弈论 1题 小学找规律 1题 矩阵树定理 1题原创 2017-09-11 20:05:34 · 279 阅读 · 0 评论 -
9.6联合作战战果
1.处理内容 图论部 最短路算法 2题 数据结构部 set 1题 链表 1题 分块 1题 hash 1题 单调栈 1题 分治树+数链剖分 1题 数学几何部 FFT 1题 线性筛 1题 2.图论部 (1)dijkstra 没什么好说的直接甩版 #include #include #include #include #include #include #include原创 2017-09-06 20:22:46 · 326 阅读 · 0 评论