Mondriaan's DreamTime Limit: 3000MS Memory Limit: 65536K
Total Submissions: 5930 Accepted: 3414
Description
Squares and rectangles fascinated the famous Dutch painter Piet Mondriaan. One night, after producing the drawings in his 'toilet series' (where he had to use his toilet paper to draw on, for all of his paper was filled with squares and rectangles), he dreamt of filling a large rectangle with small rectangles of width 2 and height 1 in varying ways.
Expert as he was in this material, he saw at a glance that he'll need a computer to calculate the number of ways to fill the large rectangle whose dimensions were integer values, as well. Help him, so that his dream won't turn into a nightmare!
Input
The input contains several test cases. Each test case is made up of two integer numbers: the height h and the width w of the large rectangle. Input is terminated by h=w=0. Otherwise, 1<=h,w<=11.
Output
For each test ca
poj 2411(插头DP 简单题)
最新推荐文章于 2020-03-14 20:52:14 发布
该博客介绍了如何使用插头动态规划(DP)方法解决一个与荷兰画家Piet Mondriaan的梦境相关的问题,即填充不同尺寸的矩形。文章包含多个测试案例的输入和输出示例,并提供了一个简单的DP代码片段。

最低0.47元/天 解锁文章
1万+

被折叠的 条评论
为什么被折叠?



