Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
线段树这题对于每个节点都有3个附加信息: ①贴着左端的最长空闲 ②贴着右端的最长空闲 ③该线段内总最长空闲 关键在查找最靠左的线段上:需要递归,如果总长小于D,则return 0,然后优先考虑左边,在考虑左边接右边,最后考虑右边。 更新三个权值时可以套用lazy-tag思想。 Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator