线段树专题

来源:互联网 发布:淘宝主管工资 编辑:程序博客网 时间:2024/04/30 07:51


最最基础的线段树,只更新叶子节点,然后把信息用PushUP(int r)这个函数更新上来。

hdu1166 敌兵布阵
线段树 hdu 1166 敌兵布阵 单点更新区间求和
hdu1754 I Hate It
线段树 hdu 1754 I Hate It 单点更新 区间求最值
hdu1394 Minimum Inversion Number
hdu 1394 Minimum Inversion Number 线段树 逆序数
hdu2795 Billboard
hdu 2795 Billboard 线段树 单点更新
UVa 12299 - RMQ with Shifts 线段树 单点更新
poj2828 BuyTickets
poj2886 Who Getsthe Most Candies?
hdu4288 Coder
CF85-DSum of Medians
CodeforcesBeta Round #19 D. Points
poj2481 Cows
hdu3950 Parking Log
hdu4521 小明系列问题——小明序列
CodeforcesBeta Round #99 (Div. 1) C Mushroom Gnomes - 2


成段更新
需要用到延迟标记(或者说懒惰标记),简单来说就是每次更新的时候不要更新到底,用延迟标记使得更新延迟到下次需要更新or询问到的时候。
hdu1698 Just a Hook
线段树 1698 Just a Hook 区间set更新
poj3468 A Simple Problem with Integers
线段树 poj 3468 A Simple Problem with Integers 区间add更新
poj2528 Mayor’s posters
Poj 2528 Mayor's posters 线段树 离散化 成段更新
poj3225 Help with Intervals
poj1436 Horizontally Visible Segments
poj2991 Crane
Another LCIS
Bracket Sequence
UVa 11992 - Fast Matrix Operations 成段更新,求最值与和
CodeforcesRound #136 (Div. 2) D. Little Elephant andArray
CodeforcesRound #169 (Div. 2) E.Little Girl and Problemon Trees
CodeforcesBeta Round #35 (Div. 2) E. Parade
Zoj3299 Fall the Brick
fzu2105 Digits Count
hdu 4533 威威猫系列故事——晒被子



区间合并
这类题目会询问区间中满足条件的连续最长区间,所以PushUp 的时候需要对左右儿子的区间进行合并。
poj3667 Hotel
Poj 3667 Hotel 线段树 区间合并
hdu3308 LCIS
hdu3397 Sequence operation
hdu2871 Memory Control
hdu1540 Tunnel Warfare
CF46-D Parking Lot




扫描线
这类题目需要将一些操作排序,然后从左到右用一根扫描线扫过去,最典型的就是矩形面积并、周长并等题。
hdu1542 Atlantis
Hdu 1542 Atlantis 线段树 求矩形面积并
hdu1828 Picture
hdu3265 Posters
hdu3642 Get The Treasury
poj2482 Stars in Your Window
poj2464 Brownie Points II
hdu3255 Farming
ural1707 Hypnotoad’s Secret
uva11983 Weird Advertisement
hdu1255 覆盖的面积
hdu4052 Adding New Machine
uestc1525 Fruit Ninja




多颗线段树问题
此类题目主用特点是区间不连续,有一定规律间隔,用多棵树表示不同的偏移区间
hdu 4288 coder
hdu 4267 A simple problem with integers


其他

hdu3954 Level up
hdu4027 Can you answer these queries?
hdu3333 Turing Tree
hdu3874 Necklace
hdu3016 Man Down
hdu3340 Rain in ACStar
zju3511 Cake Robbery
UESTC1558 Charitable Exchange
CF85-D Sum of Medians
spojGSS2 Can you answer these queries II
poj3162 WalkingRace
hdu4358 Boring counting
hdu4417 Super Mario
UVALive4730 Kingdom
CodeforcesRound #163 (Div. 2) E. More Queries toArray...

原创粉丝点击