2010年11月18日星期四

POJ 2227 The Wedding Juicer 二叉堆优先队列

题目大意是在一个布满坑的地图上灌水,求最大储水量。

显然边界的坑是无法储水的,因此可以将边界的坑都加入一个保证坑的高度最小的优先队列(用二叉堆实现)。然后每次取出队列顶端的节点进行四个方向的灌水(如果高度比当前水位高度低则可增加储水量),将未曾加入队列的节点加入队列中继续这个过程直到队列为空即可。因为是从边界开始灌水,可以保证结果的正确性,同时显然可以确定每个坑只进出队列一次。故时间复杂度为O(nmlog(nm))。

7891534    IwfWcf    2227    Accepted    1288K    1719MS    G++    1631B    2010-11-18 18:22:05

11 条评论:

  1. roshe run, http://www.rosherunshoessale.com/
    tory burch outlet, http://www.toryburchoutletonline.in.net/
    ralph lauren uk, http://www.ralphlauren-outletonline.co.uk/
    michael kors outlet, http://www.michaelkorsoutlet.org.uk/
    ralph lauren outlet, http://www.ralphlaurenoutlet.in.net/
    asics, http://www.asicsisrael.com/
    nike free, http://www.nikefreerunning.org/
    coach handbags, http://www.coachhandbagsoutletonline.us.com/
    christian louboutin uk, http://www.christianlouboutinoutlet.org.uk/
    replica watches, http://www.replicawatchesforsale.us.com/
    hogan, http://www.scarpehogan-outlet.it/
    stuart weitzman boots, http://www.stuartweitzmanoutlet.us/
    basketball shoes, http://www.basketballshoes.us.com/
    ray ban sunglasses, http://www.raybansunglass.us.com/
    nike huarache, http://www.nikeairhuarache.org.uk/
    prada outlet, http://www.pradaoutlet.us/
    michael kors handbags, http://www.michaelkorshandbag.co.uk/
    air jordan 13, http://www.airjordan13s.com/
    air max 90, http://www.airmax90.us.com/
    mulberry outlet, http://www.mulberryoutlet.com.co/
    hollister, http://www.hollistercanada.com/
    toms shoes, http://www.toms.us.com/
    louis vuitton outlet, http://www.louisvuittonoutletstore.name/
    true religion jeans, http://www.truereligionjean.in.net/
    ugg boots, http://www.uggboot.com.co/
    michael kors outlet, http://michaelkors.outletonlinestores.us.com/
    nike air max uk, http://www.nikeairmaxshoes.org.uk/
    air jordan 11, http://www.airjordan11.net/
    1003maoqiuyun

    回复删除
  2. learn the facts here now click here now websites this hyperlink official statement dolabuy.co

    回复删除

相关文章

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