![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
线段树
GreyBtfly王宝彤
业精于勤,荒于嬉;行成于思,毁于随
展开
-
[转]线段树模板习题总结——by:NotOnlySucces
博客目录线段树完全版 ~by NotOnlySuccess很早前写的那篇线段树专辑至今一直是本博客阅读点击量最大的一片文章,当时觉得挺自豪的,还去pku打广告,但是现在我自己都不太好意思去看那篇文章了,觉得当时的代码风格实在是太丑了,很多线段树的初学者可能就是看着这篇文章来练习的,如果不小心被我培养出了这么糟糕的风格,实在是过意不去,正好过几天又要给集训队讲解线段树,所以决定把这些题目重...转载 2018-06-24 17:19:45 · 1077 阅读 · 1 评论 -
前缀和 线段树 树状数组讲解(超详细入门)
博客目录Part one、前缀和 引入问题:现输入长度为n的数列co,再输入q个询问,每个询问都给出两个整数l,r。对于每个询问都要求给出对于数列co在区间[l,r]上的和(假设下标从0开始)。 1. 最直观的方法,就是直接暴力求解,每给出一对l和r,遍历数组co从l到r上所有值并求和。这是初学者最容易想到的方法,但这不是算法爱好者采用的方法,因为它的时间复杂度高达O(...原创 2018-07-27 17:52:03 · 4761 阅读 · 0 评论 -
牛客网暑期ACM多校训练营(第六场)I - Team Rocket —— 线段树经典变式 、多条件各个击破、树上搜索
其他习题--->>>博客目录线段树超详细入门讲解题目传送门(是付费的)时间限制:C/C++ 4秒,其他语言8秒空间限制:C/C++ 262144K,其他语言524288K64bit IO Format: %lld题目描述There are n trains running between Kanto and Johto region. Assuming the...原创 2018-08-09 14:32:53 · 215 阅读 · 0 评论 -
G. Lpl and Energy-saving Lamps ACM-ICPC 2018 南京赛区网络预赛 复杂度分析+线段树上搜索
博客目录原题题目链接(计蒜客) 39.72% 1000ms 65536KDuring tea-drinking, princess, amongst other things, asked why has such a good-natured and cute Dragon imprisoned Lpl in the Castle? Dragon smiled eni...原创 2018-09-02 14:08:52 · 213 阅读 · 0 评论 -
ACM-ICPC 2018 徐州赛区网络预赛 H. Ryuji doesn't want to study —— 线段树lazy标记区间修改
博客目录原题 传送门 1000ms 262144KRyuji is not a good student, and he doesn't want to study. But there are n books he should learn, each book has its knowledge a[i]a[i].Unfortunately, the longer h...原创 2018-09-09 17:01:52 · 479 阅读 · 0 评论 -
(银牌题)ACM-ICPC 2018 沈阳赛区网络预赛 J - Ka Chang dfs时间戳+树状数组+二分+分块
博客目录原题 题目传送门 18.55% 1000ms 131072KGiven a rooted tree ( the root is node 11 ) of NN nodes. Initially, each node has zero point.Then, you need to handle QQ operations. There're two types...原创 2018-09-29 12:54:44 · 889 阅读 · 0 评论