#include<cctype>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<iostream>
#include<string>
#include<queue>
#include<stack>
#include<set>
#include<map>
#define REP(i,a,b) for (i=(a);i<=(b);i++)
#define CLEAR(a) memset((a),0,sizeof((a)))
using namespace std;
typedef long long LL;
const double pi = acos(-1.0);
const int maxn=1e3+10;
const int inf=99999999;
int r,c,num[maxn],a[maxn];
void init();
void outp();
bool cmp(int a,int b)
{
return a > b;
}
int main()
{
while(~scanf("%d%d",&r,&c))
{
int ans = 0;
CLEAR(num);
getchar();
//setbuf(stdin, NULL);
for(int i=1;i<=r;i++)
{
for(int j=1;j<=c;j++)
{
char ch = getchar();
if(ch == '1') ++num[j];
else num[j] = 0;
a[j] = num[j];
}
sort(a+1,a+1+c,cmp);
for(int j=1;j<=c && a[j];j++)
ans = max(ans,a[j]*j);
setbuf(stdin, NULL);
}
printf("%d\n",ans);
}
return 0;
}
void init()
{
}
void outp()
{
}
hdu2830 TLE
最新推荐文章于 2019-03-09 15:35:36 发布