[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

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 ...
随机推荐
- 如何知道网页浏览器cookie是什么?
一直有网友问网页cookie如何获取,其实想知道自己访问网页时的cookie没那么难,用Chrome内核浏览器的debug功能就能看到,怎么查看呢?随ytkah一起来看看吧! 打开网页,按F12键,选 ...
- 002-自定义打开terminal,以及快捷键,其他程序类似,ssh管理-sshpass, Shuttle
一.利用Automator软件完成服务设定 1.使用Command+Space,打开Spotlight,搜索Automator 2.搜索到之后,双击打开,选择“服务[或快速操作]” 3.将“服务收到[ ...
- [elk]elasticsearch dsl语句
例子1 统计1,有唱歌兴趣的 2,按年龄分组 3,求每组平均年龄 4,按平均年龄降序排序 sql转为dsl例子 # 每种型号车的颜色数 > 1的 SELECT model,COUNT(DISTI ...
- ASP.NET MVC案例教程(二)
ASP.NET MVC案例教程(二) 让第一个页面跑起来 现在,我们来实现公告系统中的第一个页面——首页.它非常简单,只包括所有公告分类的列表,并且每个列表项是一个超链接.其中分类数据是用我们的Moc ...
- 2014西安赛区C题
将A[i]同他后面比他小的建边,然后求最大密度子图 #include <iostream> #include <algorithm> #include <string.h ...
- Eclipse启动报错An internal error occurred during: "Initializing Java Tooling"
Eclipse启动报错An internal error occurred during: "Initializing Java Tooling" 解决方案: 删除工作空间work ...
- MongoSpark 28799错误
Exception : . The full response is { , "codeName" : "Location28799" } at com.mon ...
- C++ WINDOWS 防多开
我们有些程序是可以同时运行多个进程,典型的像Visual Studio.但有些就能一次运行一个进程.比如Outlook.那你可能会问啥时可以让它同时打开多个应用程序,啥时只能一个啊.这个主要看进程间是 ...
- springboot使用hibernate validator校验
一.参数校验 在开发中经常需要写一些字段校验的代码,比如字段非空,字段长度限制,邮箱格式验证等等,写这些与业务逻辑关系不大的代码个人感觉有两个麻烦: 验证代码繁琐,重复劳动 方法内代码显得冗长 每次要 ...
- JavaScript 序列化、转义
JavaScript 序列化.转义 序列化 // 将对象转换为字符串 JSON.stringify() // 将字符串转换为对象类型 JSON.parse() 转义 // URl中未转义的字符 de ...