# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
99836 | naoai | Bomb (IZhO17_bomb) | C++14 | 113 ms | 19044 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define fin cin
#define fout cout
//ifstream fin("x.in"); ofstream fout("x.out");
const int nmax = 2500 + 5;
string s[nmax + 1];
int main() {
fin.sync_with_stdio(false); fin.tie(); fout.tie();
int n, m;
fin >> n >> m;
int hmax = n + 1;
int wmax = m + 1;
for (int i = 1; i <= n; ++ i)
fin >> s[i];
for (int i = 1; i <= n; ++ i) {
int a = 0;
s[i] += '0';
for (int j = 0; j <= m; ++ j) {
if (j > 0)
if (s[i][j] == '0' && s[i][j - 1] == '1')
wmax = min(wmax, a);
if (s[i][j] == '1')
++ a;
else
a = 0;
}
}
s[n + 1].resize(m + 1, '0');
for (int j = 0; j < m; ++ j) {
int a = 0;
for (int i = 1; i <= n + 1; ++ i) {
if (i > 1)
if (s[i][j] == '0' && s[i - 1][j] == '1')
hmax = min(hmax, a);
if (s[i][j] == '1')
++ a;
else
a = 0;
}
}
cout << wmax * hmax << "\n";
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |