Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Re:求助poj1991的Dp方程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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator