poj 1691 Painting A Board
来源:互联网 发布:aes256算法 java实现 编辑:程序博客网 时间:2024/05/17 06:09
这个就是15个矩形,按照涂了没涂,2^15次方个状态
然后就可以dp了
dp[i][k]表示i状态,刷子颜色为k的最优解
其实当时2了,应该k表示最后涂的方格比较好,状态会少一些
预处理出每个方格的前驱方格,然后状态转移的时候只要判断该格子的前驱是否已经涂过即可进行转移。
具体实现看代码
#include
#include
#include
using namespace std;
int turn[21];
char dp[40000][20],text[400000][20];
int n,m;
struct
{
}d[21];
struct
{
}que[1000001];
int spfa()
{
}
int main()
{
// printf("%d %d\n",i,j);
// for(int i=1;i<=tmp;i++)
// for(int j=1;j<=2;j++)
// printf("%d %d %d\n",i,j,dp[i][j]);
}
- poj 1691 Painting A Board
- POJ 1005 I Think I Need a Houseb…
- poj 3468 A Simple Problem with I…
- poj 3468 A Simple Problem with I…
- poj 3468 A Simple Problem with I…
- poj 2488
- POJ 2485 Highways
-  
- HDOJ 2101 A + B Problem Too
- POJ 3299
- poj 1905
-
- poj 3034 Whac-a-Mole dp
- poj 3468 A Simple…
- poj 3255 Roadblocks (A*)
- poj 2488 A Knight…
- A Bug's Life -Poj
- poj 1308 Is It A Tree?(并查集)
- poj 1080 Human Gene Functions dp
- poj 3034 Whac-a-Mole dp
- 求高手请进,帮我分析这种情况是什么原因
- poj 3280 Cheapest Palindrome dp(…
- poj 2948 Martian Mining dp
- poj 1691 Painting A Board
- poj 3670 Eating Together
- ACM算法训练
- 管理者,你要懂这十大黄金管理法则
- poj 2240 Arbitrage spfa求正环
- acm题目分类
- poj 1324 Holedox Moving 宽搜
- poj 2631 Roads in…
- poj Light Up dfs