Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

l 表示当前左支点转矩, r 是 右, 然后 那一个物体, 减去相应的转矩

Posted by sunmoonstar_love at 2005-08-11 11:50:18 on Problem 2547
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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator