2008年10月2日星期四

ZJU/ZOJ 2202 Alphacode 解题报告

题目大意是26个字母对应的编号分别是1-26,给出一串编码,问有多少种解码。

用f[i]表示编码的前i个字符的解码数量,f[i]=f[i-1]+f[i-2](s[i-1..i]<=26,s[i-1]<>0,s[i]<>0);f[i]=f[i-1](s[i-1..i]>26 or s[i-1]=0);f[i]=f[i-2](s[i]=0);其中s[i]表示编码的第i个字符。由于f[i]只与f[i-1]和f[i-2]有个,所以可以用滚动数组优化空间。

1653645    2008-10-02 10:43:15     Accepted    2202    FPC    0    112    IwfWcf

1 条评论:

  1. hermes birkin, http://www.hermesbirkin.org/
    chanel outlet, http://www.chaneloutletstore.us.com/
    nike free uk, http://www.nikefreerunning.org.uk/
    ray ban sunglasses, http://www.raybansunglass.com.au/
    rolex watches, http://www.rolexwatches.in.net/
    ray ban sunglasses, http://www.ray-bansunglasses.eu.com/
    yoga pants, http://www.yogapants.us.com/
    beats headphones, http://www.beats-headphones.in.net/
    michael kors outlet, http://www.michaelkorsusa.us/
    pandora jewelry, http://www.pandora.eu.com/
    cheap ugg boots, http://www.cheapuggboots.net.co/
    air jordan shoes, http://www.airjordanshoes.us.org/
    louis vuitton outlet, http://www.louisvuittonus.us.com/
    ed hardy clothing, http://www.edhardy.us.com/
    replica handbags, http://www.replicahandbag.us.com/
    the north face outlet store, http://www.thenorthfaceoutletstores.org/
    tiffany jewellery, http://www.tiffanyjewelleryoutlets.co.uk/
    lebron james shoes, http://www.lebronjamesshoes.in.net/
    gucci handbags, http://www.guccihandbags-outlet.co.uk/
    true religion outlet, http://www.truereligionoutletstore.us.com/
    swarovski jewelry, http://www.swarovski.in.net/
    michael kors outlet, http://michaelkors.outletonlinestores.us.com/
    swarovski outlet, http://www.swarovski-outlet.co.uk/
    wedding dresses, http://www.weddingdressesoutlet.co.uk/
    louis vuitton handbags, http://www.louisvuittonhandbagsoutlet.co.uk/
    lebron james shoes, http://www.lebronjames.us.com/
    nike trainers, http://www.niketrainers.me.uk/
    kobe shoes, http://www.kobeshoes.us/
    cheap snapbacks, http://www.cheapsnapbacks.us.com/
    1003maoqiuyun

    回复删除

相关文章

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