# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
44550 | nickyrio | Bomb (IZhO17_bomb) | C++17 | 111 ms | 131072 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i <= (b); ++i)
#define FORD(i, a, b) for (int i = (a); i >= (b); --i)
#define REP(i, a) for (int i = 0; i < (a); ++i)
#define DEBUG(x) { cerr << #x << '=' << x << endl; }
#define Arr(a, l, r) { cerr << #a << " = {"; FOR(_, l, r) cerr << ' ' << a[_]; cerr << "}\n"; }
#define N 2505
#define pp pair<int, int>
#define endl '\n'
#define IO ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define taskname ""
#define bit(S, i) (((S) >> (i)) & 1)
using namespace std;
string st[N];
int main() {
#ifdef NERO
freopen("test.inp","r",stdin);
freopen("test.out","w",stdout);
double stime = clock();
#else
//freopen(taskname".inp","r",stdin);
//freopen(taskname".out","w",stdout);
#endif //NERO
IO;
int n, m;
cin >> m >> n;
FOR(i, 1, m) {
cin >> st[i];
st[i] = '0' + st[i] + '0';
}
FOR(i, 0, n + 1) st[0].push_back('0');
st[m + 1] = st[0];
int w = n;
FOR(i, 1, m) {
int zero = 0;
FOR(j, 1, n + 1) {
if (st[i][j] == '0') {
if (zero + 1 != j) w = min(w, j - zero - 1);
zero = j;
}
}
}
int h = m;
FOR(j, 1, n) {
int zero = 0;
FOR(i, 1, m + 1) {
if (st[i][j] == '0') {
if (zero + 1 != i) h = min(h, i - zero - 1);
zero = i;
}
}
}
cout << h * w;
#ifdef NERO
double etime = clock();
cerr << "Execution time: " << (etime - stime) / CLOCKS_PER_SEC * 1000 << " ms.\n";
#endif // NERO
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |