递推递归
# 递推递归
OPA_heiyaa
嗨嗨嗨
展开
-
HDU--1220--数学题目
Cowl is good at solving math problems. One day a friend asked him such a question: You are given a cube whose edge length is N, it is cut by the planes that was paralleled to its side planes into N * ...原创 2020-02-26 09:43:51 · 117 阅读 · 0 评论 -
HDU--2563--递推
在一无限大的二维平面中,我们做如下假设:1、每次只能移动一格;2、不能向后走(假设你的目的地是“向上”,那么你可以向左走,可以向右走,也可以向上走,但是不可以向下走);3、走过的格子立即塌陷无法再走第二次;求走n步不同的方案数(2种走法只要有一步不一样,即被认为是不同的方案)。Input首先给出一个正整数C,表示有C组测试数据接下来的C行,每行包含一个整数n (n&l...原创 2020-02-25 10:27:00 · 184 阅读 · 0 评论 -
HDU--1396--三角形递推
Given an equilateral triangle with n the length of its side, program to count how many triangles in it.InputThe length n (n <= 500) of the equilateral triangle's side, one per line.proces...原创 2020-02-23 09:43:57 · 192 阅读 · 0 评论 -
HDU--1297--排列组合问题
There are many students in PHT School. One day, the headmaster whose name is PigHeader wanted all students stand in a line. He prescribed that girl can not be in single. In other words, either no girl...原创 2020-02-23 09:41:55 · 298 阅读 · 0 评论 -
HDU--1290--切西瓜
题意:一刀切,切的立体图形最大块数;Input输入数据包含多个测试实例,每个实例占一行,每行包含一个整数n(1<=n<=1000),表示切的刀数。Output对于每组输入数据,请输出对应的蛋糕块数,每个测试实例输出一行。Sample Input123Sample Output248思路:太难找递推方程,一般情况下立体图形方程形式ax^3+bx^2...原创 2020-02-23 09:38:44 · 150 阅读 · 0 评论 -
HDU--1207--递推递归--汉罗塔问题扩展
经典的汉诺塔问题经常作为一个递归的经典例题存在。可能有人并不知道汉诺塔问题的典故。汉诺塔来源于印度传说的一个故事,上帝创造世界时作了三根金刚石柱子,在一根柱子上从下往上按大小顺序摞着64片黄金圆盘。上帝命令婆罗门把圆盘从下面开始按大小顺序重新摆放在另一根柱子上。并且规定,在小圆盘上不能放大圆盘,在三根柱子之间一回只能移动一个圆盘。有预言说,这件事完成时宇宙会在一瞬间闪电式毁灭。也有人相信婆罗门至今...原创 2020-02-23 09:34:20 · 494 阅读 · 0 评论