Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
46788 zhouhuanyu 玙静 最大空白区 C++ 通过 1 MS 264 KB 661 2024-05-05 11:57:07

Tests(1/1):


#include <bits/stdc++.h> using namespace std; int a[40][40]; int main(){ int n, m, maxn = 0; cin >> n >> m; for(int i = 0; i < n; i++){ for(int j = 0; j < m; j++){ cin >> a[i][j]; } } for(int i = 0; i < n; i++){ for(int j = 0; j < m; j++){ int tmp = 0; for(int x = i; x >= 0; x--){ for(int y = j; y >= 0; y--){ int sum = 0; for(int a1 = i; a1 >= x; a1--){ for(int b1 = j; b1 >= y; b1--){ sum += a[a1][b1]; } } if(sum == 0){ tmp = (i - x + 1) * (j - y + 1); if(tmp > maxn){ maxn = tmp; } } } } } } cout << maxn; return 0; }


测评信息: