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

公式(new)

Posted by 0406340341 at 2007-03-31 18:07:08 on Problem 1701
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:
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