悬线法
Sqwlly
有自己热爱的东西,真好。
展开
-
BZOJ 1057 [ZJOI2007]棋盘制作 最大子矩阵(悬线法)
棋盘制作 题解:伪dp+dp+dp+悬线法 悬线法推荐一篇国家队的论文《极大化思想解决最大子矩阵问题》 讲的真是明明白白… #include<bits/stdc++.h> using namespace std; const int N = 2001; int n,m,square,rectangle; int a[N][N], Left[N][N], Right[N][N], l[...原创 2018-10-15 22:08:52 · 189 阅读 · 0 评论 -
洛谷P4147 玉蟾宫(悬线法dp)
P4147 玉蟾宫 题解:悬线dpdpdp,先预处理出悬线的左右边界。hhh数组记录能到的最高高度。然后max(h(i,j)∗(Right(i,j)−Left(i,j)+1)max(h(i,j)∗(Right(i,j)−Left(i,j)+1)max(h(i,j)∗(Right(i,j)−Left(i,j)+1)即可。 代码 #include<bits/stdc++.h> const ...原创 2018-10-23 22:25:48 · 306 阅读 · 1 评论