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 afterlastangel at 2010-01-17 20:32:00 on Problem 1476
In Reply To:请问状态转移方程是怎样的? Posted by:felips at 2007-04-16 20:32:27
> 我的如下:
> d(i,j) 表示坐第i次飞机,到达城市j的最小费用
> d(1,j)=price[1][j][1];           //第一个航班
> d(i,j)=min{d(i-1,l)+price[l][j][i%day[l][j]]}    //第i个航班
> 最后d(k,n)就是答案,Sample都过了
> 可是提交WA

In the min funtion, you must check whether  d(i-1,l) and price[l][j][i%day[l][j]] are difference 0. If all of l cities don't have any flight so the d(i,j) will be 0.  it's possible if d(k,n)<>0.

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