分情况讨论,m=1的时候比较简单,设f[i][j]为到i选了j个矩形,前缀和转移一下就行了 m=2,设f[i][j][k]为1行前i个,2行前j个,一共选了k个,i!=j的时候各自转移同m=1,否则转移一下两行矩阵的情况 #include<iostream> #include<cstdio> using namespace std; const int N=105,inf=1e9; int n,m,K,a,f[N][15],w[N][N][15],s[N],sum[N][2]; i…
F - 最大子矩阵和 Time Limit:1000MS Memory Limit:10000KB 64bit IO Format:%I64d & %I64u Description Given a two-dimensional array of positive and negative integers, a sub-rectangle is any contiguous sub-array of size 1*1 or greater located within t…