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 eharry at 2011-03-04 14:46:24 on Problem 1328
In Reply To:总算过了,一些经验 Posted by:lingd at 2008-09-14 22:35:05
为什么我用这个算法可以AC啊。


> d<=0要不要判断不知道,看别人判断了自己也加了。
> y<=0没必要判断,至少我没判断也过了。
> WA的原因很有可能是算法的错误,选择最左边的未被覆盖的点然后让覆盖它的那个圆尽可能向右移(这样可能覆盖更多的点),这个算法是错的。
> 考虑下面这个数据就知道这个算法是错的了:
> 2 3
> 0 2
> 1 3
> 正确结果是1,这个算法输出2。
> 我使用的算法是对每个点,算出覆盖它的圆心可能在的区间,然后再用贪心算法找到数目最小的点使所有的区间内都有一个点。

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