摘要: 传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=2216 【题解】 决策单调性,证明容易,略。 用整体二分的那个trick可以方便实现代码。 复杂度$O(nlogn)$ # include <math.h> # include <stdio.h 阅读全文
posted @ 2017-07-02 22:45 Galaxies 阅读(155) 评论(0) 推荐(0) 编辑
摘要: 原题传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=2687 【题目大意】 给出若干区间,求一个区间的大于等于2的子集,使得 |区间并| 和 |区间交| 的乘积最大。 $1\leq n,L_i,R_i\leq 10^6$ 【题解】 把区间去掉包 阅读全文
posted @ 2017-07-02 22:17 Galaxies 阅读(453) 评论(0) 推荐(0) 编辑
摘要: 传送门:http://acm.hdu.edu.cn/showproblem.php?pid=5909 【题解】 设$f_{x,i}$表示以$x$节点的子树中,权值为$i$的子树个数,其中$x$必选。 那么有dp方程:$f_{x,i} = \sum_{y = son[x]} f_{x,i} + \su 阅读全文
posted @ 2017-07-02 17:06 Galaxies 阅读(185) 评论(0) 推荐(0) 编辑