제출 #93568

#제출 시각아이디문제언어결과실행 시간메모리
93568TurysbekBomb (IZhO17_bomb)C++14
9 / 100
44 ms6428 KiB
// In the Name of God #include <bits/stdc++.h> using namespace std; #define ll long long #define ull unsigned long long #define ld long double #define fi first #define se second #define pb push_back #define mp make_pair #define sz(a) int(a.size()) #define all(v) v.begin(), v.end() #define bpc(v) __builtin_popcountll(v) #define itr iterator #define rep(i, a, b) for (int i = a; i <= b; ++i) #define per(i, a, b) for (int i = a; i >= b; --i) #define ub upper_bound #define lb lower_bound const int N = 25e2 + 5; const int mod = 1e8 + 7; const int inf = 1e9 + 1; const double eps = 1e-15; const int pw = 257; int n, m, last[N], cnt, x, y; string s; int main() { #ifdef Madi freopen(".in", "r", stdin); freopen(".out", "w", stdout); #endif ios_base :: sync_with_stdio(false); cin.tie(NULL); cin >> n >> m; x = n, y = m; rep(i, 1, n) { cin >> s; rep(j, 0, m - 1) { if (s[j] == '0') { if (cnt) x = min(x, cnt); cnt = 0; if (last[j] != i - 1) y = min(y, i - last[j] - 1); last[j] = i; } else ++cnt; } } cout << x * y; #ifdef Madi cerr << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n"; #endif return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...