![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
递推
文章平均质量分 64
Misdom_Tian_Ya
这个作者很懒,什么都没留下…
展开
-
POJ 1664 放苹果
Description 把M个同样的苹果放在N个同样的盘子里,允许有的盘子空着不放,问共有多少种不同的分法?(用K表示)5,1,1和1,5,1 是同一种分法。 Input 第一行是测试数据的数目t(0 Output 对输入的每组数据M和N,用一行输出相应的K。 Sample Input 1 7 3 Sample Output8原创 2015-03-16 21:22:38 · 525 阅读 · 0 评论 -
蓝桥杯题目 2的次幂表示
问题描述 任何一个正整数都可以用2进制表示,例如:137的2进制表示为10001001。 将这种2进制表示写成2的次幂的和的形式,令次幂高的排在前面,可得到如下表达式:137=2^7+2^3+2^0 现在约定幂次用括号来表示,即a^b表示为a(b) 此时,137可表示为:2(7)+2(3)+2(0) 进一步:7=2^2+2+2^0 (2^1用2表示) 3=2+2原创 2015-03-12 12:16:53 · 593 阅读 · 0 评论 -
HDU 1005 Number Sequence
Problem Description A numbersequence is defined as follows: f(1) = 1, f(2) = 1, f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7. Given A, B, and n, you are to calculate the value of f(n). Input原创 2015-04-24 10:28:47 · 415 阅读 · 0 评论 -
第四届 The number of steps
Description Mary stands in a strange maze, the maze looks like a triangle(the first layer have one room,the second layer have two rooms,the third layer have three rooms …). Now she stands at the to原创 2015-05-05 18:38:34 · 467 阅读 · 0 评论