2008年7月25日星期五

ZJU/ZOJ 1985 Largest Rectangle in a Histogram 解题报告

题目大意是给出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

4 条评论:

  1. 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

    回复删除

相关文章

 
Creative Commons License
除非另有声明,本网站采用知识共享署名-非商业性使用-相同方式共享 3.0 许可协议授权。