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

这题绝B有问题……

Posted by QHearting at 2015-02-09 09:35:11 on Problem 1014
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

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