Food delivery
Time limit:2000 msMemory limit:65536kb64bit Io format:% LLD % LlU
Description
When we are focusing on solving problems, we usually prefer to stay in front of computers rather than go out for lunch. At this time, we may call for food delivery.
Suppose there areNPeople living in a straight street that is
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3469
Food Delivery
Time
limit: 2 Seconds
Memory Limit: 65536 KB
When we is focusing on solving problems, we usually prefer to stay in front of computers rather than go out for lunch. At the this time, we are delivery.Suppose there was N people living in a straight street that was just lies on an x-coordinate axi
When we are focusing on solving problems, we usually prefer to stay in front of computers rather than go out for lunch. At this time, we may call for food delivery.
Suppose there areNPeople living in a straight street that is just lies on an X-coordinate axis.ITh person's coordinate isXIMeters. And in the street there is a take-out restaurant which has coordinatesXMeters. One day at lunchtime, each person t
Topic Links:Zoj 3469 Food DeliveryTitle Description:On the x-axis, there are n guests ordered to take out, each customer because of the update progress of different, so in the time of the external purchase of the increase in the value of anger per second different. The location of the guests and the restaurant, as well as the increased anger per minute, and the time required for a one-kilometer walk of the express brother. Ask for the minimum rage val
Title: http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3469Dp[i][j][0]: = The user of the dispatch interval [i,j] and the minimum value of the last dispatch of I dp[i][j][1]: = The user of the dispatch interval [i,j] and the minimum value of the last delivery j dp[i][j][0] = min (Dp[i+1][j][0]+cost1, DP[I+1][J][1]+COST2) dp[i][j][1] = min (dp[i][j-1][0]+cost3, DP[I][J-1][1]+COST4)Cost1 = (X[i+1]-x[i]) * (Sum[n]-sum[j]+sum[i])Cost2 = (x[j]
(Dp[i+1][j][1]+t,dp[i][j][0])To update dp[i][j][1], consider eventually stopping at J, soDp[i][j][1]=min (Dp[i][j-1][0]+t,dp[i][j][0]) T represents the cost of waiting for the rest of usDp[i][j][1]=min (Dp[i][j-1][1]+t,dp[i][j][0])#include #include#include#include#include#include#include#include#includeusing namespaceStd;typedefLong LongLL;Const intmaxn=1005;ConstLL inf=0x3f3f3f3f; LL dp[maxn][maxn][2],SUM[MAXN];structnode{LL X,val; BOOL operatorConstNode e)Const { returnxe.x; }} O[MA
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.