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 scut_lf at 2011-07-05 17:14:00 on Problem 2018
设dp[i]为以第i个数为最后一个数所能得到的最大平均值。那么dp[i]要在两种情形中选择最大值,第一种是基于dp[i-1],把第I个数作为前面串的末尾,第二种情况自己单独起一长度为F的串。

这种做法是错的···

比如
4 2
99 100 100 1
求第四个元素1的最大平均值,按上面的做法是(100+100+1)/3,但应该是(99+100+100+1)/4吧!

下面这组数据就会把这种做法check出来!
5 3
100 200 1 1 500

正确答案应该是(200+1+1+500)/4*1000 = 175500

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