
Segment Tree
文章平均质量分 83
Anpedestrian
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
leetcode-最大子序和(dp or 线段树)
最大子序和难度简单2541给定一个整数数组nums,找到一个具有最大和的连续子数组(子数组最少包含一个元素),返回其最大和。示例:输入: [-2,1,-3,4,-1,2,1,-5,4]输出: 6解释:连续子数组[4,-1,2,1] 的和最大,为6。进阶:如果你已经实现复杂度为 O(n) 的解法,尝试使用更为精妙的分治法求解。解题思路:动态规划的思想,这是一道最简单的求连续子序列和的问题,只需要在记忆化数组的基础上添加一个变量时刻更新最大的和即可,因为只...原创 2020-10-19 20:21:58 · 189 阅读 · 0 评论 -
LightOJ 1135 Count the Multiples of 3 (Segmengt + 懒惰标记)
DescriptionYou have an array with n elements which is indexed from 0 to n - 1. Initially all elements are zero. Now you have to deal with two types of operations1. Increase the numbers betw原创 2016-10-22 22:07:40 · 320 阅读 · 0 评论 -
LightOJ - 1164 Horrible Queries 线段树+懒惰标记
DescriptionWorld is getting more evil and it's getting tougher to get into the Evil League of Evil. Since the legendary Bad Horse has retired, now you have to correctly answer the evil questions o原创 2016-10-20 20:40:10 · 332 阅读 · 0 评论 -
HDU 3275 Light (线段树+懒惰标记)
LightTime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit Status Practice HDU 3275DescriptionFelicia was given a long string of fancy lanterns, but原创 2016-11-09 22:39:16 · 314 阅读 · 0 评论