题目大意是给出n个递增的的数,从中选出k+8组,每组三个数a、b、c(递增)使选出的∑(a+b)^2最小。
如果是顺推要处理第三个数比较麻烦,因此采用逆推的思想,用f[i,j]表示从第i到第n个数中选取j组数的∑(a+b)^2最小值。注意一个有效状态需要满足i-1>=2*(k-j)且n-i+1>=3*j,则f[i,j]=min(f[i+2,j-1]+(c[i+1]-c[i])^2,f[i+1,j])(n-i+1>3*j),f[i+2,j-1]+(c[i+1]-c[i])^2(n-i+1=3*j);空间复杂度可以用滚动数组优化到O(n)。
3003473 2008-07-24 23:08:37 Accepted 1234 FPC 00:00.55 19972K IwfWcf
151207meiqing
回复删除oakley sunglasses wholesale
michael kors outlet clearance
ugg australia
chanel bags
michael kors outlet stores
michael kors outlet
michaek kors outlet
prada outlet
canada goose jackets
ugg clearance
ugg outlet
replica watches
louis vuitton outlet
oakley sunglasses
canada goose outlet
kate spade handbags
louis vuitton handbags
abercrombie fitch
uggs on sale
celine
adidas originals
pandora jewelry
ray ban sunglasses outlet
michael kors bag
michael kors outlet online
uggs outlet
gucci shoes
coach outlet store online
ugg boots
cheap jordans
coach outlet
coach outlet
cheap uggs
michaek kors handbags
uggs for sale
supra shoes
uggs australia
ray-ban sunglasses
toms shoes
michael kors outlet online
Michael Kors Cheap
回复删除Michael Kors Clearance
michael kors jet set tote
michael kors outlet
Discount Michael Kors
Michael Kors Outlet Locations
kobe shoes
kd shoes
nike air max 2016
nike outlet
nike free 4.0
nike free run
christian louboutin men
christian louboutin online
mbt shoes outlet
mbt outlet
fitflop sandals
fitflops sale
Kobe 9
Nike Air Huaraches
christian louboutin store
christian louboutin sale
cheap jordans
jordan 13
jordans 2015
jordan shoes
online outlet stores
coach outlet online
zhengjx20160520
回复删除vans sneakers
kobe shoes
ray ban sunglasses uk
louis vuitton purses
ghd hair straighteners
toms wedges
ralph lauren outlet
coach outlet
coach factory outlet online
longchamp le pliage
ray ban outlet
michael kors outlet clearance
nike air max uk
oakley vault
tory burch boots
christian louboutin sale clearance
abercrombie outlet
coach outlet
louis vuitton outlet online
adidas originals store
gucci handbags
nhl jerseys
supra for sale
air max
coach factory outlet online
cheap air jordans
louis vuitton outlet
juicy couture
jordan retro 13
hollister clothing
christian louboutin shoes
oakley sunglasses
louis vuitton purses
adidas uk
gucci bags
michael kors outlet
asics running shoes
adidas running shoes
hollister clothing
coach outlet online
coach factory outlet
回复删除mbt shoes women
moncler outlet uk
michael kors outlet online
gucci outlet
steelers jerseys
cheap ugg boots
coach outlet online
cheap ray bans
true religion jeans
201612.26chenjinyan
hxy4.01
回复删除mulberry bags
ferragamo shoes
reebok outlet store
louis vuitton uk
pandora outlet
herve leger dresses
louis vuitton
michael kors outlet
michael kors handbags
gucci bags
view it have a peek here have a peek at this website 7a replica bags wholesale click to find out more Dolabuy YSL
回复删除