题目:http://www.lydsy.com/JudgeOnline/problem.php?id=3626题解:正解没yy出来,想了一个在树形态是随机的情况下的暴力。 我们由dfs序建主席树,每次沿询问的x向上爬,不妨设当前从x爬到了y,那么y的子树中编号属于(l,r)的点的个数-x的子树... Read More
posted @ 2015-03-24 22:46 ZYF-ZYF Views(398) Comments(0) Diggs(0) Edit
题目:http://www.lydsy.com/JudgeOnline/problem.php?id=3674题解:主要是可持久化的思想。膜拜了一下hzwer的代码后懂了。 其实本质是可持久化fa数组。意识到这一点就ok了。代码:戳:http://hzwer.com/3997.html不过单写... Read More
posted @ 2015-03-24 22:13 ZYF-ZYF Views(166) Comments(4) Diggs(0) Edit