# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1102906 | Muhammet | Bomb (IZhO17_bomb) | C++17 | 224 ms | 12636 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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);
}
}
if(c[1][1] == '0' and a == n and b == m) cout << 0;
else cout << a*b;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |