前言:
线段树这种数据结构是真的灵活,可以说只要是满足区间合并的信息都可以用线段树来维护。线段树可以分为区间树(叶子节点是区间)和点树(叶子节点是点),很多时候我们用的其实都是点树,但是区间树也有很大的作用。个人感觉
线段树的精髓就是区间信息的合并和区间标记的下推。
线段树的内容很多,需要学的的东西也真的事很多,一定要灵活掌握这种思想不能死板~~
一些题型和题号:(好多啊!!!)(感谢SYT学长 SYTTXWD)
基础 HDU 1166 <https://vjudge.net/problem/16216/origin> HDU 1754
<https://vjudge.net/problem/14797/origin> HDU 1698
<https://vjudge.net/problem/15763/origin> OpenJ_Bailian 3439
<https://vjudge.net/problem/1346311/origin>
偏序问题 OpenJ_Bailian 2299 <https://vjudge.net/problem/250728/origin> 牛客
<https://www.nowcoder.com/acm/contest/16/A>
离散化 OpenJ_Bailian 2528 <https://vjudge.net/problem/426410/origin>
区间合并 HDU 1540 <https://vjudge.net/problem/14794/origin> POJ 3667
<https://vjudge.net/problem/10354/origin> HDU 3308
<https://vjudge.net/problem/18578/origin> HDU 4553
<https://vjudge.net/problem/38882/origin>
扫描线 HDU 1542 <https://vjudge.net/problem/14795/origin> HDU 1255
<https://vjudge.net/problem/15768/origin> HDU 1828
<https://vjudge.net/problem/14800/origin> HDU 3642
<https://vjudge.net/problem/13041/origin>
离线处理 HDU 5091 <https://vjudge.net/problem/68249/origin> HDU 3333
<https://vjudge.net/problem/15630/origin> HDU 3333
<https://vjudge.net/problem/15630/origin>
二维 SPOJ DQUERY <https://vjudge.net/problem/32356/origin> HDU 2642
<https://vjudge.net/problem/23330/origin> POJ 2155
<https://vjudge.net/problem/10491/origin>
李超线段树 ZOJ 2859 <https://vjudge.net/problem/14803/origin>
字符串哈希 HYSBZ 1568 <https://vjudge.net/problem/37191/origin>
排序 URAL 1989 <https://vjudge.net/problem/47113/origin>
二分 CodeForces 558E <https://vjudge.net/problem/195474/origin> HDU 6070
<https://vjudge.net/problem/973702/origin>
状压 HDU 5023 <https://vjudge.net/problem/53375/origin>
DFS序 HDU 3974 <https://vjudge.net/problem/22741/origin> HDU 5877
<https://vjudge.net/problem/490585/origin> POJ 3321
<https://vjudge.net/problem/10486/origin> CodeForces 620E
<https://vjudge.net/problem/311757/origin> HDU 3804
<https://vjudge.net/problem/18728/origin>
剪枝 HDU 4027 <https://vjudge.net/problem/23290/origin> CodeForces 445E
<https://vjudge.net/problem/51703/origin> HDU 5239
<https://vjudge.net/problem/175276/origin> HDU 5306
<https://vjudge.net/problem/201743/origin>
建图 CodeForces 787D <https://vjudge.net/problem/710347/origin> HDU 5361
<https://vjudge.net/problem/215756/origin>
DP HDU 3016 <https://vjudge.net/problem/17590/origin> CodeForces 834D
<https://vjudge.net/problem/960241/origin>
lazy标记次序问题 HDU 3397 <https://vjudge.net/problem/14689/origin> HDU 4578
<https://vjudge.net/problem/46096/origin>
思维构造 HDU 5493 <https://vjudge.net/problem/248747/origin> POJ 2828
<https://vjudge.net/problem/10345/origin> CodeForces 483D
<https://vjudge.net/problem/61338/origin>
数学相关 CodeForces 719E <https://vjudge.net/problem/502959/origin> FZU 2277
<https://vjudge.net/problem/931018/origin> HDU 5930
<https://vjudge.net/problem/515818/origin> HDU 5726
<https://vjudge.net/problem/423983/origin> 牛客1
<https://www.nowcoder.com/acm/contest/147/H> 牛客2
<https://www.nowcoder.com/acm/contest/160/D>
染色 色彩分成的段数 ZOJ - 1610 <https://cn.vjudge.net/problem/11553/origin>
热门工具 换一换