[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 ...
随机推荐
- 20190422 DW/BI系统
其实很多人都不能理解操作型应用系统和分析型系统的意义,主要问题在于这两个系统所面对的用户和需求是不相同的. 建模重点“凡事应该简单,简单到不能再简单”
- iptables精通
前提基础: 当主机收到一个数据包后,数据包先在内核空间中处理,若发现目的地址是自身,则传到用户空间中交给对应的应用程序处理,若发现目的不是自身,则会将包丢弃或进行转发. iptables实现防火墙功能 ...
- 2018-2019-1 20189221 《Linux内核原理与分析》第九周作业
2018-2019-1 20189221 <Linux内核原理与分析>第九周作业 实验八 理理解进程调度时机跟踪分析进程调度与进程切换的过程 进程调度 进度调度时机: 1.中断处理过程(包 ...
- SQLite multiple threads
const int loops = 1000; public void DatabaseThreadSafetyTest() { var backgroundThread = new Thread(n ...
- C#设计模式(7)——适配器模式(Adapter Pattern)(转)
一.引言 在实际的开发过程中,由于应用环境的变化(例如使用语言的变化),我们需要的实现在新的环境中没有现存对象可以满足,但是其他环境却存在这样现存的对象.那么如果将“将现存的对象”在新的环境中进行调用 ...
- 使用Navicat定时备份mysql数据库和创建报表并邮件自动发送
数据库备份在现代计算机高速发展的今日变得日益重要,程序员往往因为不重视而忽略备份数据,导致数据丢失,造成非常严重的后果.定时备份无疑是解决备份的最好的途径,本文主要使用Navicat来自动备份数据库和 ...
- Axis2开发WebService客户端 的3种方式
Axis2开发WebService客户端 的3种方式 在dos命令下 wsdl2java -uri wsdl的地址(网络上或者本地) -p com.whir.ezoffi ...
- Vue用axios跨域访问数据
Vue用axios跨域访问数据axios是vue-resource的替代品,vue-resource不再维护.安装axios:npm install axios使用vue-cli开发时,由于项目本身启 ...
- 基于ROS和beaglebone的串口通信方式,使用键盘控制移动机器人
一.所需工具包 1.ROS键盘包:teleop_twist_keyboard 2.ROS串口通讯包:serial $ cd ~/catkin_ws/src $ git clone https://g ...
- 剑指offer(32)把数组排成最小的数
题目描述 输入一个正整数数组,把数组里所有数字拼接起来排成一个数,打印能拼接出的所有数字中最小的一个.例如输入数组{3,32,321},则打印出这三个数字能排成的最小数字为321323. 题目分析 主 ...