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:DP的话貌似很容易超时阿。In Reply To:这个题可以用dp做(前提是下属猜想成立),见内 Posted by:dugushuiyi at 2008-07-03 15:51:23 正确性尚且不考虑,如果不加优化用DP, 用V[i,j]表示取B(i)=j的时候V的最优值。 V[i,j]= min(V[i-1,k]+abs(j-k)+abs(A(i)-j))(-10000<=k<=10000) 这样, 100×10000×10000×4 超时是很容易的。 不知怎样优化呢? Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator