ACM: 动态规划题 poj&nb…
来源:互联网 发布:win7如何安装linux系统 编辑:程序博客网 时间:2024/06/05 20:21
Finally, the plate of silicon is cut into memory chips. Each chipconsists of 2*3 (or 3*2) unit squares. Of course, no chip cancontain any bad (marked) squares. It might not be possible to cutthe plate so that every good unit square is a part of some memorychip. The corporation wants to waste as little good squares aspossible. Therefore they would like to know how to cut the plate tomake the maximum number of chips possible.
Task
You are given the dimensions of several silicon plates and a listof all bad unit squares for each plate. Your task is to write aprogram that computes for each plate the maximum number of chipsthat can be cut out of the plate.
Input
Output
Sample Input
2
6 6 5
1 4
4 6
2 2
3 6
6 4
6 5 4
3 3
6 1
6 2
6 4
Sample Output
3
4
题意: 在一个矩形框内, 放置芯片2*3或3*2大小, 但是矩形框内有黑点, 不能放置的方格.
解题思路:
代码:
#include <cstdio>
#include <iostream>
#include <cstring>
using namespace std;
#define MAX 59055 //3^10 = 59049
#define MAXSIZE 152
int n, m, K;
int g[MAXSIZE][12], p[12], Q[12];
int dp[2][MAX], e, num;
int result;
inline int max(int a, int b)
{
}
inline int getState(int *p, int n)
{
}
inline void getCode(int *p, int n, int state)
{
}
void DP(int j, int *p, int *Q, int ans)
{
}
int main()
{
//
}
- ACM: 动态规划题 poj&nb…
- ACM: 动态规划题 poj&nb…
- ACM: 动态规划题 poj&nb…
- ACM: 动态规划题 poj&nb…
- ACM: 动态规划题 poj&nb…
- ACM: 动态规划题 poj&nb…
- ACM: 动态规划题 poj&nb…
- ACM: 极其简单题 uva&nb…
- ACM: dp动态规划题(难) poj 3267 …
- ACM: dp题(动态规划) poj 2151 (d…
- ACM: 树状DP 动态规划题 poj 1463 …
- ACM: LA 3266 -&nb…
- ACM: 简单动态规划题 poj 2955
- ACM: 动态规划题 poj 2241
- ACM: 动态规划题 poj 1054
- ACM: 动态规划题 poj 2948
- ACM: 动态规划题 poj 1925
- ACM: 动态规划题 poj 3034
- ACM: 动态规划题 poj&nb…
- ACM: 动态规划题 poj 2923
- 兴趣学习: opencv -- 视频读写, 鼠…
- 兴趣学习: opencv 实现画图程序
- ACM: 图论题 poj 3…
- ACM: 动态规划题 poj&nb…
- ACM: 博弈题 poj 1143 状态压缩
- ACM: 图论题 poj 2186 强连通分量
- ACM: 图论题 poj 3352 双连通题
- ACM: 图论题 poj 3177 同 3352
- Android的自定义控件起步
- dos批处理中%~dp0%的说明
- ACM: 图论题 poj 3308 最大流问题
- ACM: 搜索题 poj 1020