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:谁能讲讲这题怎么贪心吗? 只会用差分约束 (类似1201)

Posted by Hzj_jie at 2006-10-08 03:57:48 on Problem 1716
In Reply To:谁能讲讲这题怎么贪心吗? 只会用差分约束 (类似1201) Posted by:atlas_of_rruucc at 2004-08-03 00:19:31
认为每个区间为
[xi,yi]

以yi优先从小到大排序
然后从前开始,尽量往后放,这样就自然去掉的包含的情况。
比如
[x0,y0] [x1,y1]
y1>y0
如果x0>x1
则包含,这样只要先满足[x0,y0],即可满足[x1,y1]。
如果要从后往前,就得按照xi优先排序,然后尽量往前放。

如果过于详细,请版主删除,或者修改。初次发帖解释,不是很能把握。

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