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

解法

Posted by 20071002871 at 2009-12-07 10:32:44 on Problem 2393
在第i周时,有2种选择

1. C[i]*F[i];   用当前的
2. (C[j]+(i-j)*S)*F[i]   1<=j<i; 用以前的

当j=i,(C[j]+(i-j)*S)*F[i]=C[i]*F[i];

所以就是 (C[j]+(i-j)*S)*F[i]=(C[j]-j*S+i*S)*F[i]   1<=j<=i;

所以只需求出C[j]-j*S的最小值就可以了,循环时记录最小值就可以了....

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