Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- // tiom4eg's precompiler options
- // POGGERS POGGERS POGGERS POGGERS POGGERS POGGERS POGGERS
- // IO settings
- #define fastIO ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
- // Quick types
- #define ll long long
- #define ull unsigned long long
- #define pii pair <int, int>
- #define vi vector <int>
- #define mi vector <vector <int> >
- // Quick functions
- #define endl "\n"
- #define F first
- #define S second
- #define all(a) a.begin(), a.end()
- #define pb push_back
- #define fint(n) int n; cin >> n
- #define fstr(s) string s; cin >> s
- #define farr(a, n) int a[n]; for (int pog = 0; pog < n; ++pog) cin >> a[pog]
- // Quick fors
- #define FOR1(s, n) for (int i = s; i < n; ++i)
- #define FOR2(s, n) for (int j = s; j < n; ++j)
- #define FOR3(s, n) for (int k = s; k < n; ++k)
- #define RFOR(n, s) for (int l = n; l >= s; --l)
- // Pragmas
- #pragma GCC optimize("Ofast")
- #pragma GCC optimize("unroll-loops")
- #pragma GCC target("avx,fma")
- // POGGERS POGGERS POGGERS POGGERS POGGERS POGGERS POGGERS
- using namespace std;
- const int MAXN = 5001;
- int main() {
- fastIO;
- int n, m; cin >> n >> m;
- string g[n]; FOR1(0, n) cin >> g[i];
- int cur[MAXN], glob[MAXN]; FOR1(0, MAXN) cur[i] = 0, glob[i] = 0;
- int res = 0;
- FOR1(0, m) {
- FOR2(0, MAXN) cur[j] = 0;
- FOR2(0, n) {
- if (g[j][i] == '1') glob[j]++, cur[glob[j]]++;
- else glob[j] = 0;
- }
- RFOR(m, 0) cur[l] += cur[l + 1], res = max(res, cur[l] * l);
- }
- cout << res;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement