# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1102882 | Muhammet | Bomb (IZhO17_bomb) | C++17 | 222 ms | 10140 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>
using namespace std;
const int N = 2505;
int n, m;
char c[N][N];
int main(){
cin >> n >> m;
for(int i = 1; i <= n; i++){
for(int j = 1; j <= m; j++){
cin >> c[i][j];
}
}
int a = m;
for(int i = 1; i <= n; i++){
for(int j = 1; j <= m; j++){
int ind, a1 = 0;
for(ind = j; ind <= m; ind++){
if(c[i][ind] == '0') break;
a1++;
}
if(a1 != 0) a = min(a,a1);
j = ind;
}
}
int b = n;
for(int j = 1; j <= m; j++){
for(int i = 1; i <= n; i++){
int ind, b1 = 0;
for(ind = i; ind <= n; ind++){
if(c[ind][j] == '0') break;
b1++;
}
i = ind;
if(b1 != 0) b = min(b,b1);
}
}
cout << a*b;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |