# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
497102 | ACE_ | Bomb (IZhO17_bomb) | C++17 | 433 ms | 12716 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
#define f first
#define s second
#define pii pair<int,int>
using namespace std;
int t, n, m, w, h;
char a[2505][2505];
main(){
cin >> n >> m;
w = m; h = n;
for(int i = 1; i <= n; i++) {
int x = 0;
for(int j = 1; j <= m; j++) {
cin >> a[i][j];
if(a[i][j] == '0') {
if(x) w = min(w,x);
x = 0;
}
else x++;
}
if(x) w = min(w, x);
}
for(int j = 1; j <= m; j++) {
int x = 0;
for(int i = 1; i <= n; i++) {
if(a[i][j] == '0') {
if(x) h = min(h, x);
x = 0;
} else x++;
}
if(x) h = min(h, x);
}
cout << h * w;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |