递推&&递归
Sunmh_AC
这个作者很懒,什么都没留下…
展开
-
HDU 2047 阿牛的EOF牛肉串
原题: http://acm.hdu.edu.cn/showproblem.php?pid=2047 分析: 分析题意,我们知道这是一道排列计数问题。而且,题意的要求是对于给定字符串长度n,给出对应的方案数m。我很容易联想到“f(n) = m”这样的函数关系。并且,题目中的限制条件只有“两个O不能相邻”。计数 + 简单限制 = 递推。接下来的问题就是求出递推公式了。 * 第n格转载 2015-08-10 16:08:57 · 412 阅读 · 0 评论 -
Tiling POJ 2506
Description In how many ways can you tile a 2xn rectangle by 2x1 or 2x2 tiles? Here is a sample tiling of a 2x17 rectangle. Input Input is a sequence of lines, each line containing an int原创 2015-08-25 19:25:11 · 432 阅读 · 0 评论