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 Stareven at 2011-03-03 18:40:33 on Problem 3038
返回的过程可以视为再顺着走一遍,把S和E倒一下就行。
首先按照E排序,从E小到大扫描,能坐得下就尽量往里坐,用线段树记录每一段的乘客量,维护一下就行。。用数组或者堆感觉反而不好写。。线段树写还是挺快的。

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