Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

线段树

Posted by yc5_yc at 2012-07-14 10:54:19 on Problem 3667
这题对于每个节点都有3个附加信息:
①贴着左端的最长空闲
②贴着右端的最长空闲
③该线段内总最长空闲
关键在查找最靠左的线段上:需要递归,如果总长小于D,则return 0,然后优先考虑左边,在考虑左边接右边,最后考虑右边。
更新三个权值时可以套用lazy-tag思想。

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator