# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
497102 | ACE_ | Bomb (IZhO17_bomb) | C++17 | 433 ms | 12716 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |