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 |
Re:谁能讲讲这题怎么贪心吗? 只会用差分约束 (类似1201)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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator