
线段树入门
晚乔最美
这个作者很懒,什么都没留下…
展开
-
A Simple Problem with Integers(线段树+懒惰标记模板)
You have N integers, A1, A2, … , AN. You need to deal with two kinds of operations. One type of operation is to add some given number to each number in a given interval. The other is to ask for the sum of numbers in a given interval. Input The first line c原创 2020-05-19 19:02:08 · 192 阅读 · 0 评论 -
HDU-1754 I Hate It(线段树,区间最大值)
很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。 这让很多学生很反感。 不管你喜不喜欢,现在需要你做的是,就是按照老师的要求,写一个程序,模拟老师的询问。当然,老师有时候需要更新某位同学的成绩。 Input 本题目包含多组测试,请处理到文件结束。 在每个测试的第一行,有两个正整数 N 和 M ( 0<N<=200000,0<M<500...原创 2020-02-03 14:24:31 · 339 阅读 · 0 评论