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 |
l 表示当前左支点转矩, r 是 右, 然后 那一个物体, 减去相应的转矩In Reply To:帮我看看,我的DFS,怎么做二进制,我还没经验 Posted by:sunmoonstar_love at 2005-08-11 11:47:46 > bool DFS(const int &depth, const double &l, const double &r) > { > if(depth==n) > return true; > int i; > for(i=1; i<=n; i++) > { > if(!data[i].visit) > { > if(l-data[i].left>=0 && r - data[i].right<=0) > { > data[i].visit = true; > if(DFS(depth+1,l-data[i].left,r - data[i].right)) > { > printf("%d %d\n",data[i].loc,data[i].wei); > return true; > } > data[i].visit = false; > } > } > } > return false; > } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator