
线段树
文章平均质量分 86
Top_Spirit
我的指针已经找了他的对象,而我呢?
展开
-
POJ 3468 继续线段树
这次写的是接着上次的线段树写的,上次只写了线段树的单点修改,区间求最大值。然而之后又继续学习了线段树的区间修改以及区间求和的问题然后呢,这次肯定就是关于;线段树的区间修改,区间求最大值:学完之后感觉是和之前的那些差不多,都是一个思想,只不过对于一个区间的修改,也就是区间内每一个值都需要加上相同的值,时间上也就是区间修改的总的sum和,就是区间内元素的个数乘上add数组的值, add数组保存的是在某...原创 2018-03-08 10:35:10 · 188 阅读 · 1 评论 -
Codeforces A. Knight Tournament (线段树)
A. Knight Tournamenttime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputHooray! Berl II, the king of Berland is making a knight tou...原创 2019-08-13 13:25:02 · 236 阅读 · 0 评论 -
spoj GSS1 Can you answer these queries I (线段树)
You are given a sequence A[1], A[2], ..., A[N] . ( |A[i]| ≤ 15007 , 1 ≤ N ≤ 50000 ). A query is defined as follows:Query(x,y) = Max { a[i]+a[i+1]+...+a[j] ; x ≤ i ≤ j ≤ y }.Given M queries, your pr...原创 2019-07-23 10:12:41 · 284 阅读 · 0 评论 -
Group HDU - 4638 (线段树离线)
There are n men ,every man has an ID(1..n).their ID is unique. Whose ID is i and i-1 are friends, Whose ID is i and i+1 are friends. These n men stand in line. Now we select an interval of men to mak...原创 2019-07-15 10:18:27 · 132 阅读 · 0 评论 -
No Pain No Game HDU - 4630 (线段树离线)
Life is a game,and you lose it,so you suicide.But you can not kill yourself before you solve this problem:Given you a sequence of number a1, a2, ..., an.They are also a permutation of 1...n....原创 2019-07-14 19:23:10 · 158 阅读 · 0 评论 -
Newcoder MIRЯOЯ (线段树)
链接:https://ac.nowcoder.com/acm/contest/624/E来源:牛客网As most people don't know, the world has a dark side. Ramen is the peacemaker between the bright world and the dark world. The dark world is the...原创 2019-04-24 18:50:08 · 323 阅读 · 0 评论 -
Gorgeous Sequence HDU - 5306 (线段树)
Problem DescriptionThere is a sequenceaof lengthn. We useaito denote thei-th element in this sequence. You should do the following three types of operations to this sequence.0xyt: For eve...原创 2019-04-09 20:30:38 · 239 阅读 · 0 评论 -
Apple Tree POJ - 3321 (线段树+DFS序)
There is an apple tree outside of kaka's house. Every autumn, a lot of apples will grow in the tree. Kaka likes apple very much, so he has been carefully nurturing the big apple tree.The tree hasN...原创 2019-04-07 09:04:09 · 243 阅读 · 0 评论 -
Codeforces D. The Child and Sequence (线段树)
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 house...原创 2019-04-06 15:40:04 · 193 阅读 · 0 评论 -
Codeforces D. Petya and Array(权值线段树)
D. Petya and Arraytime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputPetya has an arrayaaconsisting ofnnintegers. He has learn...原创 2019-04-06 14:52:04 · 334 阅读 · 0 评论 -
Overlapping Rectangles (南宁赛区网络赛)
There are nnn rectangles on the plane. The problem is to find the area of the union of these rectangles. Note that these rectangles might overlap with each other, and the overlapped areas of these re...原创 2019-02-19 08:41:51 · 218 阅读 · 0 评论 -
Cloud Computing 线段树的思想
C. Cloud Computingtime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputBuber is a Berland technology company that specializes in was...原创 2018-11-08 20:50:27 · 202 阅读 · 0 评论 -
poj 2528 线段树区间合并
点击打开链接 poj 2528DescriptionThe 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. The ...原创 2018-04-17 20:02:23 · 220 阅读 · 0 评论 -
线段树
线段树区间求最大值 ;单点修改。线段树模版: 时间复杂度O(logn). 我觉得主要还是递归的思想,和二分思想吧。(递归建树,递归查询,递归修改)建树:void BuildTree (int i, int left, int right){ node[i].left = left; node[i].right = right; node[i].v...原创 2018-03-05 19:41:22 · 186 阅读 · 4 评论 -
Snowy Smile 19多校(线段树)
There are n pirate chests buried in Byteland, labeled by 1,2,…,n. The i-th chest's location is (xi,yi), and its value is wi, wi can be negative since the pirate can add some poisonous gases into the ...原创 2019-08-22 18:43:16 · 209 阅读 · 0 评论