![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
专题七 线段树
九羽-
日有所进,月有所变,终有所成。
展开
-
B - I Hate It HDU - 1754( 线段树变例 )
B - I Hate It HDU - 1754( 线段树变例 )很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。这让很多学生很反感。不管你喜不喜欢,现在需要你做的是,就是按照老师的要求,写一个程序,模拟老师的询问。当然,老师有时候需要更新某位同学的成绩。Input本题目包含多组测试,请处理到文件结束。在每个测试的第一行,有两个正整数 N 和 M ...原创 2019-06-26 19:31:40 · 173 阅读 · 0 评论 -
线段树入门&lazy思想
线段树入门&lazy思想推荐阅读原文:https://blog.csdn.net/u012469987/article/details/41357377#commentBox#include <cstdio>#include <cmath>#include <iostream>#include <algorithm>us...转载 2019-06-26 21:31:28 · 262 阅读 · 0 评论 -
线段树
线段树推荐看视频理解:https://www.bilibili.com/video/av47331849数组a及其组成的线段树:见图代码:#include <iostream>#include <stdio.h>using namespace std;int a[1000] = {1,3,5,7,9,11};int tree[4000] = {0}...原创 2019-06-24 21:23:20 · 1757 阅读 · 0 评论 -
A Simple Problem with Integers ( 线段树 lazy 模板 )
A Simple Problem with Integers ( 线段树 lazy 模板 )You haveNintegers,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...原创 2019-07-28 15:21:38 · 114 阅读 · 0 评论 -
Mayor's posters (线段树+离散化)
Mayor's posters (线段树+离散化)The citizens of Bytetown, AB, could not stand that the candidates in the mayoral election campaign have been placing their electoral posters at all places at their whim. T...原创 2019-08-10 09:31:08 · 221 阅读 · 0 评论 -
Count the Colors (线段树区间染色)
Count the Colors (线段树区间染色)Painting some colored segments on a line, some previously painted segments may be covered by some the subsequent ones.Your task is counting the segments of different co...原创 2019-08-10 16:43:10 · 216 阅读 · 0 评论 -
H - Can you answer these queries? (线段树)
H - Can you answer these queries? (线段树)A lot of battleships of evil are arranged in a line before the battle. Our commander decides to use our secret weapon to eliminate the battleships. Each of t...原创 2019-08-10 19:43:41 · 213 阅读 · 0 评论