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

AC了,说一下思路吧.

Posted by humanjustic at 2006-11-21 18:32:07 on Problem 1852
1.在求最小时间时,只要考虑往各自最优方向的最大值即可.
说明白点就是,如果棒长6,一个Ant在2处,那么它的最优方向是朝左走,故时间是2;一个Ant在3处,那么它的最优方向是向右走,时间是3.所以最小时间是2.
2.在求最大时间时,只要考虑往各自最坏方向的最大值即可.
如果棒长是5,一个Ant在1处,它的最坏方向是向右走,时间是4;一个Ant在3处,它的最坏方向是向左走,时间是3.
所以最长时间是4.

Just Greedy..

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