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

Re:那位大牛知道对于一个给定的时间,判断是否可行的方法阿

Posted by whus2010301500230 at 2011-10-19 20:43:06 on Problem 1744
In Reply To:那位大牛知道对于一个给定的时间,判断是否可行的方法阿 Posted by:lyg at 2006-10-15 11:21:07
int check(int t) {   //check whether t is a possible time
    int i, j, now = 0, num = 0;
    
    i = t/20 + 2;
    
    while(i <= n) {
        while(i <= n && ind[i] == 0)
            i++;
        if((i-1)*4+10*num > t)
            return 0;
        j = (t-10*num+20*i+4)/24;
        i = (t-10*num+16*j+4)/20+1;
        num++;
    }
    return 1;
}   //end check

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