
数据结构--线段树
Vmorish
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
HDU - 2795 Billboard(线段树,单点更新,最值问题)
Description At the entrance to the university, there is a huge rectangular billboard of size h*w (h is its height and w is its width). The board is the place where all possible announcements are post原创 2017-07-03 10:55:14 · 326 阅读 · 0 评论 -
HDU - 6183 Color it(线段树)
HDU - 6183 Color it(线段树) Problem Description Do you like painting? Little D doesn't like painting, especially messy color paintings. Now Little B is painting. To prevent him from drawing messy painting, Little D asks you to write a program to maintain foll原创 2017-09-07 15:02:27 · 392 阅读 · 0 评论 -
HDU - 5489 Removed Interval (dp+线段树) 2015合肥网络赛
HDU - 5489 Removed Interval (dp+线段树) 2015合肥网络赛Problem Description Given a sequence of numbers A=a1,a2,…,aN, a subsequence b1,b2,…,bk of A is referred as increasing if b1<b2<…<bk. LY has just learned how to find the longest increasing subsequence (LIS). Now转载 2017-09-13 12:55:26 · 500 阅读 · 0 评论 -
(2017多校4)1004/hdu-6070 Dirt Ratio(二分 + 线段树)
(2017多校4)1004/hdu-6070 Dirt Ratio(二分 + 线段树) Problem Description In ACM/ICPC contest, the ''Dirt Ratio'' of a team is calculated in the following way. First let's ignore all the problems the team didn't pass, assume the team passed X problems during the con原创 2017-08-04 10:44:59 · 301 阅读 · 0 评论 -
POJ - 2155 Matrix(二维线段树)
POJ - 2155 Matrix(二维线段树) Description Given an N*N matrix A, whose elements are either 0 or 1. A[i, j] means the number in the i-th row and j-th column. Initially we have A[i, j] = 0 (1 <= i, j <= N). We can change the matrix in the following way. Given原创 2017-08-09 19:38:14 · 466 阅读 · 0 评论 -
HDU - 2795 Billboard(线段树 单点更新 最值问题)
HDU - 2795 Billboard(线段树 单点更新 最值问题) Problem Description At the entrance to the university, there is a huge rectangular billboard of size h*w (h is its height and w is its width). The board is the place where all possible announcements are posted: nearest原创 2017-07-31 16:53:33 · 334 阅读 · 0 评论 -
HDU - 1394 Minimum Inversion Number(线段树 单点更新 区间查询)
HDU 1394 Minimum Inversion Number(线段树 单点更新 区间查询) The inversion number of a given number sequence a1, a2, ..., an is the number of pairs (ai, aj) that satisfy i < j and ai > aj. For a given sequence of numbers a1, a2, ..., an, if we move the first m >= 0原创 2017-07-31 17:08:19 · 226 阅读 · 0 评论 -
POJ - 3667 Hotel(线段树 区间合并 区间查询)
POJ 3667 Hotel(线段树 区间合并 区间查询) The cows are journeying north to Thunder Bay in Canada to gain cultural enrichment and enjoy a vacation on the sunny shores of Lake Superior. Bessie, ever the competent travel agent, has named the Bullmoose Hotel on famed Cumb原创 2017-07-31 21:06:17 · 297 阅读 · 0 评论 -
POJ - 2777 Count Color(线段树 成段更新 区间查询)
POJ 2777 Count Color(线段树 成段更新 区间查询) Description Chosen Problem Solving and Program design as an optional course, you are required to solve all kinds of problems. Here, we get a new problem. There is a very long board with length L centimeter, L is a pos原创 2017-08-01 08:49:32 · 335 阅读 · 0 评论 -
HDU - 4267 A Simple Problem with Integers(线段树)
HDU - 4267 A Simple Problem with Integers(线段树) Problem Description Let A1, A2, ... , AN be N elements. You need to deal with two kinds of operations. One type of operation is to add a given number to a few numbers in a given interval. The other is to query原创 2017-08-09 15:47:07 · 359 阅读 · 0 评论 -
HDU - 1542 Atlantis(线段树扫描线求矩形并的面积)
HDU - 1542 Atlantis(线段树扫描线求矩形并的面积) 线段树求矩形面积详解 Problem Description There are several ancient Greek texts that contain descriptions of the fabled island Atlantis. Some of these texts even include maps of parts of the island. But unfortunately, these maps des原创 2017-08-09 11:46:00 · 658 阅读 · 0 评论 -
POJ - 2750 Potted Flower(线段树的区间合并)
点我看题 题意:给你一个环,实时更新环上某个结点的值,让你找出连续和的最大值(不能包括所有数) 分析:线段树的区间合并 参考代码: #include #include #include #include #include using namespace std; #define ls rt<<1 #define rs rt<<1|1 const int maxn = 1e6+5; int原创 2017-07-24 15:16:51 · 272 阅读 · 0 评论 -
POJ - 3468 A Simple Problem with Integers(线段树)
本来准备下一阶段再看看线段树的,想了解一下Splay,但是匡斌的博客刚好以这个题为例讲Splay,然后就先用线段树写了这个题写了这个题... 题意:区间更新,区间求和. 分析:直接套模板吧,但是要注意数据范围,改用long long千万不要用int的哇. 参考代码: #include #include #include #include #include原创 2017-07-24 10:04:15 · 220 阅读 · 0 评论 -
HDU-1166 敌兵布阵 (树状数组 or 线段树)
Description C国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采取了某种先进的监测手段,所以每个工兵营地的人数C国都掌握的一清二楚,每个工兵营地的人数都有可能发生变动,可能增加或减少若干人手,但这些都逃不过C国的监视。 中央情报局原创 2017-07-02 19:06:07 · 323 阅读 · 0 评论