题目大意是给出一份购物清单,要求按照清单上的顺序在超市中顺序购买,求购买的最少花费。
用一个数组记录下每个物品序号在购物清单中的可能位置,从大到小倒推,状态转移方程是f[i]=min(f[i],f[i-1]+c[j]);(1<=i<=m,1<=j<=n)。其中f[i]表示购买购物清单上的第i个物品所需的最少花费,初始化时将除f[0]外的所有f[i]赋上一个极大值,则可利用此来判断是否可能购买第i件物品。c[j]表示超市中第j件物品的价格。如果DP完成后f[m]仍然是初始值则可判断不可能买齐购物清单上的物品,否则输出f[m]的值。
3069052 2008-09-14 00:29:57 Accepted 1524 FPC 00:00.12 500K IwfWcf
toms outlet, http://www.tomsoutlet-stores.com/
回复删除nike roshe, http://www.nikerosherunshoes.co.uk/
prada handbags, http://www.pradahandbagsoutlet.co.uk/
soccer jerseys, http://www.cheapsoccerjersey.net/
michael kors outlet store, http://www.michaelkorsoutlet-store.us.com/
true religion jeans, http://www.truereligionjeansoutlets.us.com/
oakley sunglasses, http://www.oakleysunglasses-outlet.us.com/
nike free 5, http://www.nikefree5.us/
louis vuitton bags, http://www.louisvuittonbag.us.com/
chanel handbags, http://www.chanelhandbags-outlet.co.uk/
chanel handbags, http://www.chanelhandbags-outlet.us.com/
louis vuitton handbags, http://www.louisvuittonhandbag.us/
louis vuitton outlet, http://www.louisvuittonoutlet.in.net/
ghd hair straighteners, http://www.ghdhairstraightenerssale.co.uk/
nba jerseys, http://www.nbajerseys.us.com/
coach outlet, http://www.coachoutletstores.com.co/
true religion jeans, http://www.truereligionjeanscanada.com/
swarovski crystal, http://www.swarovskicrystals.co.uk/
mbt shoes, http://www.mbtshoesoutlet.us.com/
michael kors handbags, http://www.michaelkorshandbags.in.net/
chanel handbags, http://www.chanelhandbagsoutlet.in.net/
michael kors outlet online, http://www.michaelkorsoutletonline.in.net/
polo ralph lauren, http://www.poloralphlauren.us.org/
the north face clearance, http://www.thenorthfaceclearances.us.com/
jordan shoes, http://www.jordan-shoes.us.com/
beats by dr dre, http://www.beatsbydrdre-headphones.us.com/
the north face uk, http://www.thenorthfaces.org.uk/
1003maoqiuyun
cheap pandora jewelry
回复删除chaussures jordan
nike basketball shoes
ray ban glasses
christian louboutin
michael kors
fitflop sandals
louis vuitton
fitflop clearance
louis vuitton handbags clearance
201612.26chenjinyan
vans shoes
回复删除converse
kobe sneakers
kyrie 4
curry 6
kobe 11
supreme clothing
yeezys
calvin klein underwear
adidas ultra
visit the website look what i found look at here now check out this site click this over here now Full Article
回复删除