[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 ...
随机推荐
- varnish缓存系统基础知识
缓存系统类型 1.页面缓存/pageCache 缓存静态资源(html js css image) 例如:varnish squid 2.数据缓存/dataCache 缓存应 ...
- python基础(11)-常用模块
re(正则)模块 常用方法 findall() 以列表返回所有满足条件的结果 import re print(re.findall('\d','a1b2c2abc123'))#['1', '2', ' ...
- abap 断言
1: Assert equal http://www.saptechnical.com/Tutorials/OOPS/ABAPUnit/Index.htm
- DAX/PowerBI系列 - 参数表(Parameter Table) 度量值模板
DAX/PowerBI系列 - 参数表(Parameter Table) 度量值模板 难度: ★★☆☆☆(2星) 适用范围: ★★★☆☆(3星) 概况: 当你有多个度量值都需要计算YTD,MoM,而又 ...
- PHP多维数组转一维
目录 1. array_column函数 2. array_walk函数 3. array_map函数 4. foreach循环 5. array_map变种 参考:https://www.awaim ...
- 2019年度【计算机视觉&机器学习&人工智能】国际重要会议汇总
简介 每年全世界都会举办很多计算机视觉(Computer Vision,CV). 机器学习(Machine Learning,ML).人工智能(Artificial Intelligence ,AI) ...
- gateway + jwt 网关认证
思路: 全局过滤器对所有的请求拦截(生成token有效期30分钟,放入redis设置有效期3天.3天之类可以通过刷新接口自动刷新,超过3天需要重新登录.) 前端在调用接口之前先判断token是否过期( ...
- Vue将px转化为rem适配移动端
Vue将px转化为rem适配移动端 1.下载lib-flexible我使用的是vue-cli+webpack,所以是通过npm来安装的npm i lib-flexible --save 2.引入lib ...
- iptables 扩展匹配 第三章
获取帮助: centos 6 :man iptables centos 7: man iptables-extensions 扩展匹配: 隐式扩展:当使用-p指定某一协议之后,协议自身所支持的扩展就叫 ...
- Python 匿名变量
匿名变量的使用 calc = lambda x:x*3 print(calc(3)) 注:匿名变量是没有名字的变量 注:使用:lambda 创建.