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:MS我是贪心过的..

Posted by superzyb at 2009-05-08 10:25:00 on Problem 2393
In Reply To:MS我是贪心过的.. Posted by:humanjustic at 2007-04-10 15:30:37
> 只要考虑相邻WEEK的价格差与S的关系就可以.
从当前月往后面比较,一旦现在生产比后面某个月份生产更加实惠,则生产,否则一旦后面某个月份生产比现在生产实惠,则说明后面的月份可以由这个实惠点的月份来生产,不用当前月份考虑了,所以break。
例如第一个月份费用是10,存储费用是5,第二个月份是11,则显然第二个月份后面的月份都考虑与第二个月比较就行了,如果第二个月份是17,则还得拿第一个月份的和后面的比,直到遇到一个比第一个月份更加实惠的。40MS可以过。

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