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

思路哪错?

Posted by litter at 2009-09-20 21:23:25 on Problem 1275
s[i]-s[i-8]>=need[i];        转化成:      s[i-8]<=s[i]-need[i] 0<=i<=23;
person[i]>=s[i]-s[i-1]>=0      转化成:    s[i-1]<=s[i]+0;s[i]<=s[i-1]+person[i]  

for(i=0;i<=23;i++)
        {
            edge[counter].start=i;
            edge[counter].end=(i-8+24)%24;
            edge[counter++].dis=-need[i];
            edge[counter].start=i;
            edge[counter].end=(i-1+24)%24;
            edge[counter++].dis=0;
            edge[counter].start=(i-1+24)%24;
            edge[counter].end=i;
            edge[counter++].dis=person[i];
        }  
               

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