이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
int n, m;
const int maxn = 2504;
int prevw;
int prevh[maxn];
int main() {
cin >> n >> m;
int maxpossiblew = maxn;
int maxpossibleh = maxn;
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= m; j++) {
char x;
cin >> x;
if (x == '1') {
prevw++;
prevh[j]++;
} else {
if (prevw > 0) {
maxpossiblew = min(maxpossiblew, prevw);
}
if (prevh[j] > 0) {
maxpossibleh = min(maxpossibleh, prevh[j]);
}
prevw = 0;
prevh[j] = 0;
}
}
if (prevw > 0) {
maxpossiblew = min(maxpossiblew, prevw);
}
prevw = 0;
}
for (int j = 1; j <= m; j++) {
if (prevh[j] > 0)
maxpossibleh = min(maxpossibleh, prevh[j]);
}
cout << maxpossibleh * maxpossiblew << endl;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |