# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
833241 | vjudge1 | Bomb (IZhO17_bomb) | C++11 | 196 ms | 6500 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <stdio.h>
int main() {
int n,m;
scanf("%d %d",&n,&m); getchar();
bool arr[n][m];
for(int i = 0; i < n; i++) {
for(int j = 0; j < m; j++) {
char c;
scanf("%c",&c);
arr[i][j] = (c == '1');
} getchar();
}
int h = 5000, w = 5000;
for(int i = 0; i < n; i++) {
int thisH = 5000, cur = 0;
for(int j = 0; j < m; j++) {
if(arr[i][j])
cur++;
if(cur && (!arr[i][j] || j == m-1)) {
thisH = cur < thisH ? cur : thisH;
cur = 0;
}
}
h = thisH < h ? thisH : h;
}
for(int i = 0; i < m; i++) {
int thisW = 5000, cur = 0;
for(int j = 0; j < n; j++) {
if(arr[j][i])
cur++;
if(cur && (!arr[j][i] || j == n-1)) {
thisW = cur < thisW ? cur : thisW;
cur = 0;
}
}
w = thisW < w ? thisW : w;
}
printf("%d\n",h < 5000 && w < 5000 ? h*w : 0);
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |