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 |
公式(new)ren=k[1];sum=0;down[1]=0; for(i=2;i<=m;i++) { down[i] = down[i-1]+sum+b*ren; sum+=ren;ren+=k[i]; } ren=k[m];sum=0;up[m]=0; for(i=m-1;i>=1;i--) { up[i] = up[i+1]+sum+a*ren; sum+=ren;ren+=k[i]; } min=1; for(i=1;i<=m;i++) { f[i]=down[i]+up[i]; if(f[i]<f[min]) min=i; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator