131. Hardwood floor time limit per test: 0.25 sec. The banquet hall of Computer Scientists' Palace has a rectangular form of the size M x N (1<=M<=9, 1<=N<=9). It is necessary to lay hardwood floors in the hall. There are wood pieces of two forms: Input The first line contains natural number M. The second line contains a natural number N. Output First line should contain the number X, or 0 if there are no solutions. Sample Input 2 3 Sample Output 5 |
轮廓线DP。由于这两种放法会占用下一填充块的下方位置。所以边界需将当前填充块的下方考虑进去。 压缩状态时加一位,表示该位置。 代码:
|
sgu131 Hardwood floor
最新推荐文章于 2019-09-04 18:01:00 发布