[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 ...
随机推荐
- vue 环境报错 chromedriver@2.44.1 install: `node install.js`
解决办法: 1. yarn add chromedriver -g 2.yarn add chromedriver --chromedriver_cdnurl=http://cdn.npm.taoba ...
- 把spring boot发布成window Service
一:下载Winsw, 把下载后的文件名改为你的应用如doctor.exe 二:添加xml <service> <id>doctor-api-service</id> ...
- 关于view.py 中 ajax json 的用法
1. data=models.Citys.objects.filter(upid=0) data 的数据形式是一个查询集(也是一个列表,查询出来的每一条数据是一个对象): <QuerySet [ ...
- 安装archlinux的linux命令记录
磁盘的分区:cfdisk 格式化分区:mkfs.ext4,mkswap,swapon 查看所有分区:lsblk /dev/sda 先挂载 / 分区:mount /dev/sda1 /mnt archl ...
- CentOS 7 系统优化
系统调优4大子系统 1:找出系统中使用CPU最多的进程 2:找出系统中使用内存最多的进程 3:找出系统中对磁盘读写最多的进程 4:找出系统中使用网络最多的进程 系统调优概述 系统的运行状况: CPU ...
- Angular4的依赖注入
- 腾讯云服务器使用smtp发送邮件
问题:在腾讯云服务器上使用自编写的邮件服务失败.查其原因,是该邮件服务调用smtpclient.Send(mailMessage)时,出现错误:由于连接方在一段时间后没有正确答复或连接的主机没有反应, ...
- kubernetes1.4新特性(一):支持sysctl命令
sysctl是一个允许改变正在运行中的Linux系统内核参数的接口.可以通过sysctl修改Linux系统内核中的TCP/IP 堆栈和虚拟内存系统的高级选项,而且不需要重新启动Linux系统,就可以实 ...
- windows安装composer总结
1.直接去网吧下载windows安装EXE程序,傻瓜式安装,so easy. 2.通过命令行安装,可以直接在php目录跑起来 php -r "readfile('https://getcom ...
- php 使用str_replace替换关键词(兼容字符串,一维数组,多维数组)
通过递归的方式来实现替换字符串. /* * * 使用str_replace替换关键词(兼容字符串,一维数组,多维数组) * $search 需要查找的内容 * $replace 需要替换的内容 * $ ...