![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
线段树
yyy_3y
这个作者很懒,什么都没留下…
展开
-
[线段树] (线段树 + 扫描线 + 离散化)
POJ 1151 && HDU 1542 Atlantis 做模板 #include<cstdio> #include<cstring> #include<algorithm> #include<vector> #include<queue> #include<cmath> using namespa原创 2018-02-25 21:52:44 · 734 阅读 · 0 评论 -
Codeforces_961E_Tufurama(树状数组or线段树)
传送门 题意:有一部电视剧有n季,每一季有ai集。问有多少对i,j存在第i季第j集也同时存在第j季第i集。 思路:核心问题还是统计对于第i季,你要统计第i行(存在多少数量,要大于i)。 线段树的维护相对而言比较暴力,树状数组的话,一开始全是1,一旦某个数过小,就会导致不构成贡献,移除就好。 tips:对于这样的题目,可以首先思考排序,这样可以省去一维操作。 线段树: #includ...原创 2018-04-16 20:16:05 · 276 阅读 · 0 评论