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

Re:这题如何用贪心做啊?

Posted by Ruby931031 at 2012-12-01 00:48:27 on Problem 1201
In Reply To:这题如何用贪心做啊? Posted by:1292765944 at 2012-11-29 21:33:21
把输入的区间按照右端点从小到大排序,每次查询当前区间内的点是否已经足够,
若不够则从区间右边开始取点,直至恰好满足该区间所要求的点数。
实现的时候用线段树吧……

不过这题还是用差分约束系统做顺一些。

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