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

这题我DP可以AC,贪心却挂了,为什么呢

Posted by yu_ at 2007-06-21 01:50:48 on Problem 1700
我贪心思路是:
先让走最快的两个人过去;
while(还有人没过河)
{
最快的那人回来,
最慢两个人过去,
第二快的回来,
第一快,第二快的一起过去;
}

我还分奇偶考虑了
如果是偶数个人,那么经过上述便可走完
如果为奇数,经过上述之后还剩一个人,然后最快的那个人回来带他过河

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