线段树
Lesroad
这个作者很懒,什么都没留下…
展开
-
hdu2795——Billboard
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 p原创 2017-08-13 18:42:30 · 211 阅读 · 0 评论 -
Lightoj1080硬币翻转次数(区段更新)
Given a binary number, we are about to do some operations on the number. Two types of operations can be here.'I i j' which means invert the bit from i toj (inclusive)'Q i' answer whether t原创 2017-08-13 18:51:16 · 305 阅读 · 0 评论 -
HDU - 1541——star
Astronomers often examine star maps where stars are represented by points on a plane and each star has Cartesian coordinates. Let the level of a star be an amount of the stars that are not higher and原创 2017-08-13 19:03:07 · 225 阅读 · 0 评论 -
线段树单点更新+求和
第一行一个整数T,表示有T组数据。 每组数据第一行一个正整数N(N<=50000),表示敌人有N个工兵营地,接下来有N个正整数,第i个正整数ai代表第i个工兵营地里开始时有ai个人(1<=ai<=50)。接下来每行有一条命令,命令有4种形式: (1) Add i j,i和j为正整数,表示第i个营地增加j个人(j不超过30) (2)Sub i j ,i和j为正整数,表示第i个营地原创 2017-08-13 18:38:54 · 256 阅读 · 0 评论 -
【HDU1698】区段更新
题意:一段线段由n条小线段组成,每次操作把一个区间的小线段变成金银铜之一(金的价值为3,银为2,铜为1),最初可当做全为铜;最后求这条线段的总价值。11021 5 25 9 3Sample Output Case 1: The total value of the hook is 24.#include#include#include#define N 1原创 2017-08-13 19:01:39 · 240 阅读 · 0 评论