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:这题绝B有问题……In Reply To:这题绝B有问题…… Posted by:QHearting at 2015-02-09 09:35:11 > > int dfs(int n){ > int i; > > if(n==0){ > return 1; > } > for(i=6; i>0; i--){ > if(value[i]>0 && n>=i){ > value[i] --; > if(dfs(n-i)) return 1; > // value[i] ++; > } > } > > return 0; > } > 回溯恢复那行注释掉过了,不注释掉tle 我也是醉了,网上流传的DFS代码不回溯 Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator