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

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

题目链接:

题目大意:有一个 3*n 的矩阵,每个格子里有一个数,你可以选择相邻的两个格子合并成一个,并且权值变为两数乘积,若一个数未合并,权值变为0,求最后权值总和最大值。

题目思路:以 2^3 状态压缩。

#include 
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define lson rt<<1,l,mid#define rson rt<<1|1,mid+1,r#define fi first#define se second#define ping(x,y) ((x-y)*(x-y))#define mst(x,y) memset(x,y,sizeof(x))#define mcp(x,y) memcpy(x,y,sizeof(y))using namespace std;#define gamma 0.5772156649015328606065120#define MOD 1000000007#define inf 0x3f3f3f3f#define N 2000005#define maxn 100005typedef pair
PII;typedef long long LL;int n,m,cnt,ans;int a[1005][5];int dp[1005][10];int deal(int x,int u,int e){ for(int i=0;i<3;++i)if((u&(1<
<

 

转载于:https://www.cnblogs.com/Kurokey/p/5877391.html

你可能感兴趣的文章
本地git连接github
查看>>
WebService
查看>>
AC自动机板子(from. qwer)
查看>>
codevs1958 刺激
查看>>
firefox 访问12306.cn提示有风险但没有添加例外选项
查看>>
HDOJ题目(11.22-12.22)
查看>>
Jenkins-在windows上配置自动化部署(Jenkins+Bonobo.Git.Server)
查看>>
15个来自 CodePen 的酷炫 CSS 动画效果【下篇】
查看>>
那些带给我们强烈视觉冲击的 JavaScript 特效网站
查看>>
Bitmap和Drawable相互转换方法
查看>>
android开发环境以及genymotion虚拟机配合HBuilder测试(自总结)
查看>>
uva 10051 Tower of Cubes(DAG最长路)
查看>>
ios实例开发精品源码文章推荐
查看>>
一些技巧
查看>>
Ultra-QuickSort(数组排序问题)
查看>>
ASP.NET 超时设置
查看>>
Matlab程序 转C++/Opencv基于Mat 不可不知的17个函数
查看>>
#import和importlib的区别
查看>>
bzoj 2054: 疯狂的馒头
查看>>
SQL 公用表达式CTE
查看>>