# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
170218 | andrew | Bomb (IZhO17_bomb) | C++17 | 127 ms | 8100 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#pragma GCC optimize("-O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#define fi first
#define se second
#define p_b push_back
#define pll pair<ll,ll>
#define pii pair<int,int>
#define m_p make_pair
#define all(x) x.begin(),x.end()
#define sset ordered_set
#define sqr(x) (x)*(x)
#define pw(x) (1ll << x)
#define sz(x) (int)x.size()
using namespace std;
typedef long long ll;
typedef long double ld;
const ll MAXN = 1123456;
const ll N = 2e6;
const ll inf = 3e18;
mt19937_64 rnd(chrono::system_clock::now().time_since_epoch().count());
template <typename T> void vout(T s){cout << s << endl;exit(0);}
char c[3001][3001];
int main(){
ios_base :: sync_with_stdio(0);
cin.tie(0);
#ifdef LOCAL
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif // LOCAL
ll n, m;
ll h, w;
h = w = inf;
cin >> n >> m;
for(int i = 1; i <= n; i++)
for(int j = 1; j <= m; j++)cin >> c[i][j];
for(int i = 1; i <= n; i++){
ll kol = 0;
for(int j = 1; j <= m; j++){
if(c[i][j] == '0'){
if(kol)h = min(h, kol);
kol = 0;
}else kol++;
}
if(kol)h = min(h, kol);
}
for(int j = 1; j <= m; j++){
ll kol = 0;
for(int i = 1; i <= n; i++){
if(c[i][j] == '0'){
if(kol)w = min(w, kol);
kol = 0;
}else kol++;
}
if(kol)w = min(w, kol);
}
cout << h * w << "\n";
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |