标签:des style http color os io for ar
3 4 1011 1001 0001 3 4 1010 1001 0001
4 2 Note: Huge Input, scanf() is recommended.
#include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<limits.h> using namespace std; int n,m; char str[1100]; int num[1100],sum[1100]; int cmp(int a,int b) { return a>b; } int main() { while(~scanf("%d%d",&n,&m)) { getchar(); char ch; int ans=0; memset(num,0,sizeof(num)); for(int i=1;i<=n;i++) { for(int j=1;j<=m;j++) { scanf("%c",&ch); if(ch=='1') num[j]++; else num[j]=0; sum[j]=num[j]; } sort(sum+1,sum+m+1,cmp); for(int i=1;i<=m;i++) ans=max(ans,sum[i]*i); getchar(); } printf("%d\n",ans); } return 0; }
HDU 2830 Matrix Swapping II,布布扣,bubuko.com
标签:des style http color os io for ar
原文地址:http://blog.csdn.net/u013582254/article/details/38305549