摘要: 题解 显然树形 \(dp\) 一波 然后套路的运用标题 \(Code\) #include<cstdio> #include<iostream> #define ls (p << 1) #define rs (ls | 1) using namespace std; typedef long lon 阅读全文
posted @ 2021-01-22 11:42 leiyuanze 阅读(107) 评论(0) 推荐(0) 编辑
摘要: 题解 两只 \(\log\) 的动态 \(dp\) ! 相比标算倍增 动态 \(dp\) 既实用又好理解 \(Code\) #include<cstdio> #include<iostream> #define ls (p << 1) #define rs (ls | 1) using namesp 阅读全文
posted @ 2021-01-22 10:31 leiyuanze 阅读(114) 评论(0) 推荐(0) 编辑
摘要: 题解 本题的解法是丰富多彩的! 线段树做法是极好的 代码非常之少 一个很显然的想法是维护 \(n+1\) 颗线段树 那要怎么维护才能不爆空间呢? 我们发现尽管 \(n \times m\) 那么大 但 \(q\) 相比 \(n \times m\) 小得多 也就是说变动的点比较少 于是我们抓住这点 阅读全文
posted @ 2021-01-22 07:37 leiyuanze 阅读(123) 评论(0) 推荐(0) 编辑