Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
46782 | sunhuifeng | 最大空白区 | C++ | Time Limit Exceeded | 1000 MS | 232 KB | 556 | 2024-05-05 11:55:00 |
#include<iostream> using namespace std; int main(){ int n,m; cin>>n>>m; int maxn=-1; int a1[31][31]; for(int i=0;i<=n;i++){ for(int j=0;j<m;j++){ cin>>a1[i][j]; } } for(int i=0;i<n;i++){ for(int j=0;j<m;j++){ int tmp=0; for(int x=i;i>=0;x--){ for(int y=j;y>=0;y--){ int sum=0; for(int a=i;a>=x;a--){ for(int b=j;b>=y;b--){ sum+=a1[a][b]; } } if(sum==0){ tmp=(i-x+1)*j-y+1; if(tmp>maxn) maxn=tmp; } } } } } cout<<maxn; return 0; }