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 Cathy11 at 2011-05-10 15:14:08 on Problem 1716
先根据起点排序
每次找到两个数能取到的右边界。
1.如果新加入的区间[start,end]和原来区间无公共部分,则两个数的右边界分别为end-1,end;表示第一个数最大能够取到end-1,第二个数最大能够取到end;个数+2
2.如何只有一个交点,第一个能够取到start,第二个能够取到end,个数+1
3.有多个交点,这个稍微复杂点,需要认真考虑

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