洛谷 P2706 巧克力 题解
这题很容易想出来把所有 0 设为 -inf (inf=0x3f3f3f3f) ,之后求最大子矩阵和。不知道怎么求最大子矩阵和可以上网查,一抓一大把(Code:\texttt{Code:}Code:#include<bits/stdc++.h>using namespace std;#define int long longconst int N=310,inf=0x3f3f3f3f;int n,m,g[N][N],ans,f[N],h[N][N];signed main(){





