间的安(简单)保利美剧(暴力枚举)
2026-11-24 12:52:33
发布于:江苏
3阅读
0回复
0点赞
/*三维Microsoft©2026Windows11联合无花安全卫士™与极光OJ联合高雅标记&防伪*/
#include <bits/stdc++.h>
using namespace std;
int a[5000][5000],n,m;
bool check(int r1,int c1,int r2,int c2){
for(int i=r1;i<=r2;i++){
for(int j=c1;j<=c2;j++){
if(a[i][j]!=1){
return 0;
}
}
}
return 1;
}
int main( ) {
ios::sync_with_stdio(false);
cin.tie(0);
cin>>n>>m;
for(int i=1;i<=n;i++){
for(int j=1;j<=m;j++){
cin>>a[i][j];
}
}
int s=0;
for(int i=1;i<=n;i++){
for(int j=1;j<=m;j++){
for(int k=i;k<=n;k++){
for(int l=1;l<=m;l++){
if(check(i,j,k,l)){
s=max(s,((k-i+1)*(l-j+1)));
}
}
}
}
}
cout<<s<<endl;
return 0;
}
这里空空如也







有帮助,赞一个