博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
UVAlive 6560 - The Urge to Merge(状压dp)
阅读量:4662 次
发布时间:2019-06-09

本文共 362 字,大约阅读时间需要 1 分钟。

LA 6560 - The Urge to Merge

思路:状压dp,1表示要和下一个位置竖直乘。0表示不,这样递推下去就可以

代码:

#include 
#include
#include
using namespace std;const int N = 1005;const int INF = 0x3f3f3f3f;int g[N][3], dp[2][8], n;bool judge(int u, int f) { for (int i = 0; i < 3; i++) if (u&(1<

转载于:https://www.cnblogs.com/wzjhoutai/p/6922607.html

你可能感兴趣的文章