
线段树
文章平均质量分 81
Head_Hard
菜逼一个
展开
-
leetcode 850. 矩形面积 II 【矩形面积并】【线段树】【扫描线】
我们给出了一个(轴对齐的)矩形列表rectangles。 对于rectangle[i] = [x1, y1, x2, y2],其中(x1,y1)是矩形i左下角的坐标,(x2,y2)是该矩形右上角的坐标。找出平面中所有矩形叠加覆盖后的总面积。 由于答案可能太大,请返回它对 10 ^ 9 + 7 取模的结果。示例 1:输入:[[0,0,2,2],[1,0,2,3],[1,0,3,...原创 2019-09-07 14:14:00 · 884 阅读 · 0 评论 -
codeforces 240F TorCoder 【线段树】
门F. TorCodertime limit per test3 secondsmemory limit per test256 megabytesinputinput.txtoutputoutput.txtA boy named Leo doesn't miss a single TorCoder contest round. On the last To...原创 2018-08-06 22:19:25 · 259 阅读 · 0 评论 -
POJ 2750 Potted Flower 【线段树】【区间合并】
Potted FlowerTime Limit: 2000MS Memory Limit: 65536K Total Submissions: 5315 Accepted: 2078 DescriptionThe little cat takes over the management of a new park. There is a large ...原创 2018-08-10 15:56:27 · 271 阅读 · 0 评论 -
POJ 2886 Who Gets the Most Candies? 【线段树】【约瑟夫环】
Who Gets the Most Candies?Time Limit: 5000MS Memory Limit: 131072K Total Submissions: 16076 Accepted: 5081 Case Time Limit: 2000MS DescriptionN children are sitting in a circ...原创 2018-08-10 14:47:39 · 235 阅读 · 0 评论 -
POJ 2828 Buy Tickets 【线段树】【倒插】
#include<cstdio>#include<cstring>using namespace std;#define lson rt << 1, l, mid#define rson rt << 1 | 1, mid + 1, rconst int MAX = 1e6 + 7;int n;int pos[MAX], val[MAX...原创 2018-08-10 14:45:38 · 183 阅读 · 0 评论 -
codeforces 438 D The Child and Sequence 【线段树】【区间mod】
门D. The Child and Sequencetime limit per test4 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAt the children's day, the child came to Picks's hou...原创 2018-08-10 14:36:07 · 191 阅读 · 0 评论 -
BZOJ 1798 [Ahoi2009]Seq 维护序列seq 【线段树】
1798: [Ahoi2009]Seq 维护序列seqTime Limit: 30 Sec Memory Limit: 64 MBSubmit: 8243 Solved: 3015[Submit][Status][Discuss]Description老师交给小可可一个维护数列的任务,现在小可可希望你来帮他完成。 有长为N的数列,不妨设为a1,a2,…,aN 。有如下三种操作形...原创 2018-08-05 22:36:41 · 212 阅读 · 0 评论 -
POJ 1177 Picture 【线段树】【矩形周长并(横纵扫描线、离散化)】
PictureTime Limit: 2000MS Memory Limit: 10000K Total Submissions: 13668 Accepted: 7191 DescriptionA number of rectangular posters, photographs and other pictures of the same sh...原创 2018-08-09 21:46:31 · 335 阅读 · 0 评论 -
codeforces 786B Legacy 【线段树建图】【最短路】
链接 B. Legacytime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputRick and his co-workers have made a new radioactive formula and ...原创 2018-08-05 22:00:13 · 233 阅读 · 0 评论 -
HDU 1255 覆盖的面积 【线段树】【矩形面积交(扫描线,离散化)】
覆盖的面积Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 7580 Accepted Submission(s): 3828 Problem Description给定平面上若干矩形,求出被这些矩形覆盖过至少两次的区...原创 2018-08-09 20:00:57 · 223 阅读 · 0 评论 -
POJ 2482 Stars in Your Window【线段树】【扫描线】
Stars in Your WindowTime Limit: 1000MS Memory Limit: 65536K Total Submissions: 14106 Accepted: 3847 DescriptionFleeting time does not blur my memory of you. Can it really be 4 ...原创 2018-08-12 11:10:05 · 448 阅读 · 0 评论 -
sdut 4295 种西瓜 (2018西安邀请赛K)【线段树】
种西瓜Time Limit: 1000 ms Memory Limit: 65536 KiBProblem Description现在郭小冉决定在瓜场种m年西瓜。首先他有n块西瓜地。第i块西瓜地每年可以将会生产出b(i)颗西瓜。每一年ta都会回到西瓜地。每一年ta有两种操作,一种是选择一段连续的土地查询它们这些年的产量总和。另外一种是选择一段连续的土地,并把它们的每一块的年产...原创 2018-08-03 15:31:27 · 658 阅读 · 2 评论 -
ACM-ICPC 2018 南京赛区网络预赛 G Lpl and Energy-saving Lamps 【线段树】
During tea-drinking, princess, amongst other things, asked why has such a good-natured and cute Dragon imprisoned Lpl in the Castle? Dragon smiled enigmatically and answered that it is a big secret. A...原创 2018-09-06 21:46:16 · 235 阅读 · 0 评论 -
Uva 11992 Fast Matrix Operations 【线段树】【双标记pushdown】
#include<bits/stdc++.h>using namespace std;#define lson rt << 1, l, mid#define rson rt << 1 | 1, mid + 1, rconst int MAX = 1e5 + 7;const int INF = 0x3f3f3f3f;struct node{ ...原创 2018-08-28 22:17:30 · 174 阅读 · 0 评论 -
codeforces 138 C Mushroom Gnomes - 2 【线段树】【离散化】【概率】
C. Mushroom Gnomes - 2time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputOne day Natalia was walking in the woods when she met a lit...原创 2018-08-28 20:41:21 · 670 阅读 · 0 评论 -
POJ 2991 Crane 【线段树】【向量旋转】
ACM has bought a new crane (crane -- jeřáb) . The crane consists of n segments of various lengths, connected by flexible joints. The end of the i-th segment is joined to the beginning of the i + 1-th ...原创 2018-08-27 21:40:11 · 245 阅读 · 0 评论 -
HDU 4521 小明系列问题——小明序列 【线段树】【lis】
大家都知道小明最喜欢研究跟序列有关的问题了,可是也就因为这样,小明几乎已经玩遍各种序列问题了。可怜的小明苦苦地在各大网站上寻找着新的序列问题,可是找来找去都是自己早已研究过的序列。小明想既然找不到,那就自己来发明一个新的序列问题吧!小明想啊想,终于想出了一个新的序列问题,他欣喜若狂,因为是自己想出来的,于是将其新序列问题命名为“小明序列”。 提起小明序列,他给出的定义是这样的: ①首先...原创 2018-08-23 13:53:52 · 223 阅读 · 0 评论 -
HDU 6447 YJJ's Salesman 【线段树】【dp】【离散化】
YJJ's SalesmanTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1109 Accepted Submission(s): 378 Problem DescriptionYJJ is a salesman w...原创 2018-08-26 21:13:18 · 224 阅读 · 0 评论 -
codeforces 1023 D Array Restoration 【线段树】
D. Array Restorationtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputInitially there was an array aa consisting of nn integers. Po...原创 2018-08-18 21:41:37 · 295 阅读 · 0 评论 -
codeforces19D Points 【线段树】
Pete and Bob invented a new interesting game. Bob takes a sheet of paper and locates a Cartesian coordinate system on it as follows: point (0, 0) is located in the bottom-left corner, Ox axis is direc...原创 2018-08-18 19:44:26 · 283 阅读 · 0 评论 -
HDU 4288 Coder 【暴力】OR 【线段树】
In mathematics and computer science, an algorithm describes a set of procedures or instructions that define a procedure. The term has become increasing popular since the advent of cheap and reliable ...原创 2018-08-18 10:43:50 · 215 阅读 · 0 评论 -
牛客网暑期ACM多校训练营(第六场)【线段树】
链接:https://www.nowcoder.com/acm/contest/144/A来源:牛客网 Singing Contest时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 262144K,其他语言524288K64bit IO Format: %lld题目描述Jigglypuff is holding a singing contest. There...原创 2018-08-05 12:41:31 · 198 阅读 · 0 评论 -
HDU 1542 Atlantis 【线段树】【矩形面积交(扫描线、离散化)】
AtlantisTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 18271 Accepted Submission(s): 7406 Problem DescriptionThere are several ancie...原创 2018-08-09 10:40:47 · 247 阅读 · 0 评论 -
HDU 1698 Just a Hook【线段树】
Just a HookTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 36885 Accepted Submission(s): 18007Problem DescriptionIn the game of D原创 2018-01-19 23:19:57 · 189 阅读 · 0 评论 -
Educational Codeforces Round 37 (Rated for Div. 2) 【F】【线段树】
门F. SUM and REPLACEtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputLet D(x) be the number of positiv原创 2018-02-19 16:21:16 · 243 阅读 · 0 评论 -
HDU 4893 Wow! Such Sequence!【线段树】
Wow! Such Sequence!Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 4823 Accepted Submission(s): 1408Problem DescriptionRecently,原创 2018-03-07 20:29:30 · 228 阅读 · 0 评论 -
HDU 4027 Can you answer these queries?【线段树】
Can you answer these queries?Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65768/65768 K (Java/Others)Total Submission(s): 21008 Accepted Submission(s): 4980Problem Description原创 2018-03-06 20:06:40 · 177 阅读 · 0 评论 -
POJ 3468 A Simple Problem with Integers【线段树】
A Simple Problem with IntegersTime Limit: 5000MS Memory Limit: 131072KTotal Submissions: 123941 Accepted: 38439Case Time Limit: 2000MSDescriptionYou have N原创 2018-01-19 17:17:14 · 261 阅读 · 0 评论 -
HDU 1556 Color the ball【线段树】
Color the ballTime Limit: 9000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 24378 Accepted Submission(s): 11841Problem DescriptionN个气球排成一排,从左到右原创 2018-01-20 13:37:39 · 219 阅读 · 0 评论 -
HDU 1166 敌兵布阵【树状数组】【线段树】
敌兵布阵Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 104637 Accepted Submission(s): 44049Problem DescriptionC国的死对头A国这段时间正在进行军事演习,所原创 2018-01-15 16:43:35 · 256 阅读 · 0 评论 -
线段树模板
void Update(int rt, int l, int r, int x, int y, int val) ///区间更新,求和;{ if(x = r) { a[rt] += val * (r - l + 1); lazy[rt] += val; return; } if(lazy原创 2018-01-19 17:23:46 · 207 阅读 · 0 评论 -
HDU 1754 I Hate It【线段树】
I Hate ItTime Limit: 9000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 87639 Accepted Submission(s): 33515Problem Description很多学校流行一种比较的习惯。老师们很原创 2018-01-19 16:17:53 · 145 阅读 · 0 评论 -
HDU 1540 Tunnel Warfare 【线段树】
Tunnel WarfareTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 10962 Accepted Submission(s): 4305Problem DescriptionDuring the War原创 2018-03-21 21:40:08 · 176 阅读 · 0 评论 -
hrbust 2371 GT’s Dream 【线段树】【并查集】
GT’s DreamTime Limit: 1000 MSMemory Limit: 256000 KTotal Submit: 83(31 users)Total Accepted: 29(21 users)Rating: Special Judge: NoDescription在原创 2018-03-27 21:01:00 · 255 阅读 · 0 评论 -
HDU 6315 Naive Operations 【线段树】【树状数组】
Naive Operations Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 502768/502768 K (Java/Others) Total Submission(s): 1620 Accepted Submission(s): 689 Problem Description ...原创 2018-07-26 17:13:24 · 229 阅读 · 0 评论 -
HDU 4614 Vases and Flowers 【线段树】【二分】
Vases and FlowersTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 4402 Accepted Submission(s): 1811Problem Description Alice is so popular th...原创 2018-06-18 14:52:15 · 291 阅读 · 0 评论 -
HDU 3974 Assign the task 【线段树】【dfs序】
Assign the taskTime Limit: 15000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4704 Accepted Submission(s): 1879Problem DescriptionThere is a company that h...原创 2018-06-10 11:20:33 · 170 阅读 · 0 评论 -
ZOJ 1610 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 colors you can see at last.InputTh...原创 2018-05-29 22:41:41 · 156 阅读 · 0 评论 -
POJ 3264 Balanced Lineup 【RMQ】OR 【线段树】
For the daily milking, Farmer John's N cows (1 ≤ N ≤ 50,000) always line up in the same order. One day Farmer John decides to organize a game of Ultimate Frisbee with some of the cows. To keep things ...原创 2018-05-28 18:12:18 · 188 阅读 · 0 评论 -
POJ 2528 Mayor's posters 【线段树】【离散化】【染色】
Mayor's postersTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 74111 Accepted: 21378DescriptionThe citizens of Bytetown, AB, could not stand that the candidates in the mayoral election campa...原创 2018-05-27 17:32:37 · 184 阅读 · 0 评论