题目大意是给出n个柱形的高度,求其中最大的矩形面积。
用left[i]表示取第i个柱形达最大面积时最左端的柱形,right[i]表示取第i个柱形达最大面积时最右端的柱形。则可顺推出left[i]=left[left[i]-1](2<=i<=n,h[left[i]]>=h[i],left[i]>1),逆推出right[i]=right[right[i]+1](1<=i<=n-1,h[right[i]>=h[i],right[i]<n)。然后扫一遍根据left[i]和right[i]计算面积即可。
3005375 2008-07-25 22:48:33 Accepted 1985 FPC 00:00.23 1584K IwfWcf
abercrombie and fitch, http://www.abercrombie-fitch.us.com/
回复删除cheap jordans, http://www.cheapjordanshoes.in.net/
cheap wedding dresses, http://www.cheap-weddingdresses.net/
oakley sunglasses, http://www.oakleysunglassescanada.com/
nike mercurial, http://www.nikemercurial.org/
michael kors outlet, http://www.michaelkorsoutletonlinstore.us.com/
ray ban sunglasses, http://www.raybansunglassesonline.us.com/
prada shoes, http://www.pradashoes.us/
moncler coats, http://www.moncler.us.com/
oakley sunglasses, http://www.wholesaleoakleysunglasses.us.com/
lacoste polo shirts, http://www.lacostepoloshirts.cc/
cheap oakley sunglasses, http://www.cheapoakleysunglassess.us.com/
adidas outlet store, http://www.adidasoutletstore.us.com/
north face outlet, http://www.thenorthface.me/
gucci, http://www.borseguccioutlet.it/
ugg outlet, http://www.uggsoutlet.us.org/
mulberry outlet, http://mulberryoutlet.outlet-store.co.uk/
ray ban sunglasses, http://www.rayban-sunglassess.us.com/
canada goose outlet, http://www.canadagoose.us.org/
futbol baratas, http://www.futbol-baratas.com/
kobe bryant shoes, http://www.kobebryantshoes.in.net/
cheap mlb jerseys, http://www.cheapmlbjerseys.net/
timberland boots, http://www.timberlandboots.name/
cheap nfl jerseys, http://www.cheapnfljerseys.org/
longchamp handbags, http://www.longchamphandbag.us.com/
michael kors outlet, http://www.michaelkorsoutletcanada.in.net/
montblanc pens, http://www.montblanc-pens.com.co/
coach outlet store, http://www.coach-outlet-store.us.com/
1003maoqiuyun
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
ralph lauren outlet
回复删除adidas trainers uk
louis vuitton outlet
tory burch outlet online
oakley sunglasses outlet
louis vuitton outlet
canada goose jackets
ray ban clubmaster
louis vuitton handbags
louis vuitton
201612.26chenjinyan
bengals jersey
回复删除boston celtics jersey
eagles jerseys
nike outlet
canada goose jackets
giuseppe zanotti outlet