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:DFS也过了,可是用了170ms,好吧In Reply To:先贴一个bfs,再看看dfs Posted by:TSERROF at 2012-10-19 11:01:38 bool DFS(long long now) { if(now>1222222222222222222 || now<0 )return false; if(now%n==0) { cout<<now<<endl; return true; } if(DFS(now*10))return true; if(DFS(now*10+1))return true; return false; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator