摘要: 线段树几个基本操作 单点查询 单点修改 区间查询 区间修改 区间求最大值 主要思想: 将一个线性的一维数组构建成树形的数组,使得可以用二分的思想来进行区间操作,降低时间复杂度,但是多占用了空间,典型的用空间换时间。 一个特殊的模块: lazy数组,考虑到对区间的操作有很多次,并且没有必要每一次对区间 阅读全文
posted @ 2018-08-05 21:52 Daybreaking 阅读(162) 评论(0) 推荐(0) 编辑
摘要: A rooted tree is a well-known data structure in computer science and engineering. An example is shown below: In the figure, each node is labeled with 阅读全文
posted @ 2018-08-05 21:26 Daybreaking 阅读(178) 评论(0) 推荐(0) 编辑
摘要: Description Natasha is planning an expedition to Mars for nn people. One of the important tasks is to provide food for each participant. The warehouse 阅读全文
posted @ 2018-08-05 16:03 Daybreaking 阅读(184) 评论(0) 推荐(0) 编辑
摘要: Description A bracket sequence is a string containing only characters "(" and ")". A regular bracket sequence is a bracket sequence that can be transf 阅读全文
posted @ 2018-08-05 15:58 Daybreaking 阅读(262) 评论(0) 推荐(0) 编辑
摘要: You have a Petri dish with bacteria and you are preparing to dive into the harsh micro-world. But, unfortunately, you don't have any microscope nearby 阅读全文
posted @ 2018-08-05 15:53 Daybreaking 阅读(250) 评论(0) 推荐(0) 编辑