| ||||||||||
| 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 | |||||||||
Re:回朔加强剪枝过了In Reply To:Re:回朔加强剪枝过了 Posted by:gzw_02 at 2008-05-23 23:05:23 > Hi 我也是搜索加剪枝.
> 但是有一组数据过不了.
> 0 6001 0 6999 0 7000
> 要加一个判断
> if(half%2==1&&a[5]==0&&a[3]==0&&a[1]==0)
> {//不加这个判断,搜索算法TL
> cout<<"Collection #"<<no<<":"<<endl<<"Can't be divided."<<endl<<endl;
> no++;
> continue;
> }
>
> PS:其实这个也是剪枝的一种,呵呵.
这个应该是对2,4,6的剪枝吧。
还有一个针对3,6的类似剪枝。我两个都加了,0毫秒。但是不太确定为什么这就0毫秒。。。
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator