| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 334681 | limabeans | Bomb (IZhO17_bomb) | C++17 | 115 ms | 18924 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
template<typename T>
void out(T x) { cout << x << endl; exit(0); }
#define watch(x) cout << (#x) << " is " << (x) << endl
using ll = long long;
const int maxn = 2600;
int n,m;
string g[maxn];
int main() {
ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
cin>>n>>m;
for (int i=1; i<=n; i++) {
cin>>g[i];
g[i]="0"+g[i]+"0";
}
g[0]=string(m+5,'0');
g[n+1]=string(m+5,'0');
int minW = m+10;
for (int i=1; i<=n; i++) {
int cur = 0;
for (int j=1; j<=m+1; j++) {
if (g[i][j]=='1') {
cur++;
} else {
if (cur>0) {
minW=min(minW,cur);
}
cur=0;
}
}
}
int minH=n+10;
for (int j=1; j<=m; j++) {
int cur = 0;
for (int i=1; i<=n+1; i++) {
if (g[i][j]=='1') {
cur++;
} else {
if (cur>0) {
minH=min(minH,cur);
}
cur=0;
}
}
}
// watch(minW);
// watch(minH);
int area = minW*minH;
out(area);
return 0;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
