[poj P2411] Mondriaan's Dream
[poj P2411] Mondriaan's Dream
| Time Limit: 3000MS | Memory Limit: 65536K | |
| Total Submissions: 18023 | Accepted: 10327 |
Description

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
Output
For each test case, output the number of different ways the given rectangle can be filled with small rectangles of size 2 times 1. Assume the given large rectangle is oriented, i.e. count symmetrical tilings multiple times.Sample Input
1 2 1 3 1 4 2 2 2 3 2 4 2 11 4 11 0 0
Sample Output
1 0 1 2 3 5 144 51205
Source
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<vector>
#define LL long long
#define idx(x,i) ((x>>i)&1)
using namespace std;
;
<<lim];
vector <<<lim];
bool jug(int su,int sd) {
; i<m; i++) {
int ku=idx(su,i),kd=idx(sd,i);
if (!kd&&ku) continue;
; else
if (!kd) {
&&!idx(su,i+)) su|=<<(i+); ;
}
}
;
}
int main() {
while (scanf("%d%d",&n,&m),n|m) {
S=<<m;
; i<S; i++) o[i].clear();
; i<S; i++)
; j<S; j++) if (jug(i,j)) o[j].push_back(i);
memset(f,,][]=;
; i<=n; i++)
; j<S; j++)
,s=o[j].size(); k<s; k++)
f[i][j]+=f[i-][o[j][k]];
printf(]);
}
;
}
[poj P2411] Mondriaan's Dream的更多相关文章
- PKU P2411 Mondriaan's Dream
PKU P2411 Mondriaan's Dream 题目描述: Squares and rectangles fascinated the famous Dutch painter Piet Mo ...
- POJ 2411 Mondriaan's Dream -- 状压DP
题目:Mondriaan's Dream 链接:http://poj.org/problem?id=2411 题意:用 1*2 的瓷砖去填 n*m 的地板,问有多少种填法. 思路: 很久很久以前便做过 ...
- POJ 2411 Mondriaan's Dream 插头dp
题目链接: http://poj.org/problem?id=2411 Mondriaan's Dream Time Limit: 3000MSMemory Limit: 65536K 问题描述 S ...
- POJ - 2411 Mondriaan's Dream(轮廓线dp)
Mondriaan's Dream Squares and rectangles fascinated the famous Dutch painter Piet Mondriaan. One nig ...
- [POJ] 2411 Mondriaan's Dream
Mondriaan's Dream Time Limit: 3000MS Memory Limit: 65536K Total Submissions: 18903 Accepted: 10779 D ...
- [poj 2411]Mondriaan's Dream (状压dp)
Mondriaan's Dream Time Limit: 3000MS Memory Limit: 65536K Total Submissions: 18903 Accepted: 10779 D ...
- Poj 2411 Mondriaan's Dream(状压DP)
Mondriaan's Dream Time Limit: 3000MS Memory Limit: 65536K Description Squares and rectangles fascina ...
- Poj 2411 Mondriaan's Dream(压缩矩阵DP)
一.Description Squares and rectangles fascinated the famous Dutch painter Piet Mondriaan. One night, ...
- poj 2411 Mondriaan's Dream(状态压缩dp)
Description Squares and rectangles fascinated the famous Dutch painter Piet Mondriaan. One night, af ...
随机推荐
- Ubuntu虚拟机识别不了SD卡的解决办法
前提,你的虚拟机已经安装了VMware Tools. Step 1: 出现这种情况先查看计算机中的虚拟机的VMware USB Arbitration Service是否启用(注意是VMware US ...
- 逆向 AWS API 设计
由于AWS并没有像Google一样公开出一份API Design Guide,所以只能根据 API 的模样去逆向工程最初的设计考量.既然上一篇介绍了很多 REST 的缺陷,那么这里也会介绍一下 AWS ...
- day07 Python文件操作
一,文件操作基本流程 #1. 打开文件,得到文件句柄并赋值给一个变量 f=open('a.txt','r',encoding='utf-8') #默认打开模式就为r #2. 通过句柄对文件进行操作 d ...
- Django框架详细介绍---ORM---图书信息系统专题训练
from django.db import models # Create your models here. # 书 class Book(models.Model): title = models ...
- List 循环删除 指定元素的 方法
使用Iterator进行循环,在删除指定元素.如果使用for 或 foreach 在删除指定下标是,list.size 会相应的缩短且下标前移,导致相邻满足条件的元素未删除 Iterator<S ...
- [autocomplete]如果条目末尾有空格,MustMatch不起作用
如果mustMatch被激活,我们发现,当条目最后包含一个空格时,一旦我们从列表中选择值,它将被拒绝.我们已经发现了这个问题,它在搜索事件中:在第184行,您修剪了输入的值: $.each(trimW ...
- Oarcle之视图
视图 什么是视图? (在 SQL 中,视图是基于 SQL 语句的结果集的可视化的表. 视图包含行和列,就像一个真实的表.视图中的字段就是来自一个或多个数据库中的真实的表中的字段.我们可以向视图添加 S ...
- AndroBench手机性能测试【转】
本文转载自:https://www.cnblogs.com/jiangzhishan/archive/2018/07/16/9316279.html AndroBench是一个基准测试应用程序,可以衡 ...
- jQuery validator plugin之Validator
Validator.destroy() Destroys this instance of validator freeing up resources and unregistering event ...
- Learning-Python【8】:Python字符编码
1.内存和硬盘都是用来存储的 内存:速度快 硬盘:永久保存 2.文本编辑器存取文件的原理(nodepad++,pycharm,word) 打开编辑器就可以启动一个进程,是在内存中的,所以在编辑器编写的 ...