| ||||||||||
| 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 | |||||||||
这题我DP可以AC,贪心却挂了,为什么呢我贪心思路是:
先让走最快的两个人过去;
while(还有人没过河)
{
最快的那人回来,
最慢两个人过去,
第二快的回来,
第一快,第二快的一起过去;
}
我还分奇偶考虑了
如果是偶数个人,那么经过上述便可走完
如果为奇数,经过上述之后还剩一个人,然后最快的那个人回来带他过河
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator