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:求助poj1991的Dp方程

Posted by Yinthewind at 2012-04-08 19:07:35 on Problem 1991
In Reply To:Re:求助poj1991的Dp方程 Posted by:597100700 at 2011-10-09 21:34:41
 47     memset(f,0x1f,sizeof(f));
 48     int N=q.size();
 49     f[0][N-1]=0;
 50     for(int l=N-1;l;l--)
 51     {
 52         for(int i=0;i+l<N;i++)
 53         {
 54             int j=i+l;
 55             f[i+1][j]=min(f[i+1][j],max(f[i][j]+q[i+1].d-q[i].d,q[i+1].t));
 56             f[j][i+1]=min(f[j][i+1],max(f[i][j]+q[j].d-q[i].d,q[j].t));
 57             f[j-1][i]=min(f[j-1][i],max(f[j][i]+q[j].d-q[j-1].d,q[j-1].t));
 58             f[i][j-1]=min(f[i][j-1],max(f[j][i]+q[j].d-q[i].d,q[i].t));
 59         }
 60     }

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