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 |
解法在第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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator