dp
G-Howe
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Advanced Fruits
说白了,这个题就是让找两个字符串的最短母串下面是代码,也是找最短母串的模板The company "21st Century Fruits" has specialized in creating new sorts of fruits by transferring genes from one fruit into the genome of another one. Most tim...原创 2018-07-24 19:42:12 · 294 阅读 · 0 评论 -
Train Problem II
这题是一个Catalan数,利用公式h(n)=h(n-1)*(4*n-2)/(n+1),其实还可以用其他卡特兰公式,但这个用起来更简单,但是涉及大数问题,用C写比较麻烦,本人用了最近师哥讲的JAVA写的.As we all know the Train Problem I, the boss of the Ignatius Train Station want to know if all t...原创 2018-07-25 19:46:27 · 349 阅读 · 0 评论 -
一卡通大冒险
因为长期钻研算法, 无暇顾及个人问题,BUAA ACM/ICPC 训练小组的帅哥们大部分都是单身。某天,他们在机房商量一个绝妙的计划"一卡通大冒险"。这个计划是由wf最先提出来的,计划的内容是,把自己的联系方式写在校园一卡通的背面,然后故意将自己的卡"遗失"在某处(如水房,TD,食堂,主M。。。。)他们希望能有MM看到他们遗失卡,能主动跟他们联系,这样就有机会请MM吃饭了。他们决定将自己的一卡通夹...原创 2018-07-26 16:06:07 · 196 阅读 · 0 评论 -
Karen and Game
To stay woke and attentive during classes, Karen needs some coffee!Karen, a coffee aficionado, wants to know the optimal temperature for brewing the perfect cup of coffee. Indeed, she has spent so...原创 2018-10-05 09:57:40 · 212 阅读 · 0 评论 -
Adjacent Bit Counts
题意是求满足给定长度的01串构成给定的数,一共有多少种方法,用动态规划,dp数组除了存储数位,大小,还需要考虑最后一位的情况,(1)如果最后一位是0,则在添加一位,串的长度变了,但值不变,即dp[i][j][0]=dp[i-1][j][0]+dp[i-1][j][1];(2)如果最后一位是1,则dp[i][j]等于i-1长度值为j最后一位为0的情况和i-1长度下值为j-1且最后一位为1的情况...原创 2018-10-21 16:23:33 · 243 阅读 · 0 评论
分享