Advertisement
tiom4eg

A

Nov 16th, 2021
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.50 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. // tiom4eg's precompiler options
  3. // POGGERS POGGERS POGGERS POGGERS POGGERS POGGERS POGGERS
  4. // IO settings
  5. #define fastIO ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
  6. // Quick types
  7. #define ll long long
  8. #define ull unsigned long long
  9. #define pii pair <int, int>
  10. #define vi vector <int>
  11. #define mi vector <vector <int> >
  12. // Quick functions
  13. #define endl "\n"
  14. #define F first
  15. #define S second
  16. #define all(a) a.begin(), a.end()
  17. #define pb push_back
  18. #define fint(n) int n; cin >> n
  19. #define fstr(s) string s; cin >> s
  20. #define farr(a, n) int a[n]; for (int pog = 0; pog < n; ++pog) cin >> a[pog]
  21. // Quick fors
  22. #define FOR1(s, n) for (int i = s; i < n; ++i)
  23. #define FOR2(s, n) for (int j = s; j < n; ++j)
  24. #define FOR3(s, n) for (int k = s; k < n; ++k)
  25. #define RFOR(n, s) for (int l = n; l >= s; --l)
  26. // Pragmas
  27. #pragma GCC optimize("Ofast")
  28. #pragma GCC optimize("unroll-loops")
  29. #pragma GCC target("avx,fma")
  30. // POGGERS POGGERS POGGERS POGGERS POGGERS POGGERS POGGERS
  31. using namespace std;
  32.  
  33. const int MAXN = 5001;
  34.  
  35. int main() {
  36.     fastIO;
  37.     int n, m; cin >> n >> m;
  38.     string g[n]; FOR1(0, n) cin >> g[i];
  39.     int cur[MAXN], glob[MAXN]; FOR1(0, MAXN) cur[i] = 0, glob[i] = 0;
  40.     int res = 0;
  41.     FOR1(0, m) {
  42.         FOR2(0, MAXN) cur[j] = 0;
  43.         FOR2(0, n) {
  44.             if (g[j][i] == '1') glob[j]++, cur[glob[j]]++;
  45.             else glob[j] = 0;
  46.         }
  47.         RFOR(m, 0) cur[l] += cur[l + 1], res = max(res, cur[l] * l);
  48.     }
  49.     cout << res;
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement