2008年8月4日星期一

ZJU/ZOJ 1206 Win the Bonus 解题报告

题目大意是给出m个长度为3的字串,用0-9组合成长度为n的字串,如果字串中能够匹配这m个字串则能够得到相应的加/减分。求得分最高的字串,当得分相同时输出字串对应数值最小的。

用f[i,j]表示匹配到第i个字符,第i位和第i+1位组成的字串为j时的最高得分。状态转移方程是f[i,k*10+j div 10]=max(f[i,k*10+j div 10],f[i+1,j]+v[k*100+j])(0<=k<=9,0<=j<=99);k即第i位上的数,j即第i+1位和i+2位上的数,v[k*100+j]即第i位到第i+2位所组成的三位字串的得分。用一个数组记录下f[i,k*10+j div 10]是由f[i+1,j]变化而得,最后从max(f[1,j])(当有多个最大值时,j取最小值)顺推即可得到所求字串。

1663079    2008-10-10 23:18:07     Accepted    1206    FPC    470    4924    IwfWcf@LZOI

7 条评论:

  1. The MEGA888 (Mega 888) mobile slot game will provide players with the best gaming slot experience. There are a lot of online casino slot games and fantasy
    “Mega” means big and 888 means luck. Mega888 is the online casino that is big in games and winnings.
    MEGA888

    回复删除
  2. Thansk for sharing What an interesting site you have i really take a good look buy cocaine online and you can also take a good look at our blog too for more information buy crack cocaine online we also recommend you to take a good look at this site too they have good content buy mdma crystals online more of the site still want you to take a closer look too as they have really good content buy crystal meth online thanks for using your time to check on the link.

    回复删除

相关文章

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