Matrix Swapping II
来源:互联网 发布:画江湖之不良人 知乎 编辑:程序博客网 时间:2024/04/29 09:07
http://acm.hdu.edu.cn/showproblem.php?pid=2830
#include <stdio.h>
#include <string.h>
#include <algorithm>
using namespace std;
int cmp(int a,int b)
{
return a>b;
}
int main()
{
int n,m,i,j,k,t,ans,num[1010],row[1010];
char ch;
while(scanf("%d%d",&n,&m)!=EOF)
{
getchar();
ans=0;
memset(num,0,sizeof(num));
for(i=1;i<=n;i++)
{
for(j=1;j<=m;j++)
{
scanf("%c",&ch);
if(ch=='1')
num[j]++;
else
num[j]=0;
row[j]=num[j];
}
sort(row+1,row+m+1,cmp);
for(j=1;j<=m;j++)
if(ans<row[j]*j)
ans=row[j]*j;
getchar();
}
printf("%d\n",ans);
}
return 0;
}
0 0
- HDU2830--Matrix Swapping II
- Matrix Swapping II
- Matrix Swapping II
- Matrix Swapping II
- Matrix Swapping II
- 2830 Matrix Swapping II
- HDU2830-Matrix Swapping II
- Matrix Swapping II hdu2830
- hdu 2830 Matrix Swapping II
- HDU 2830 Matrix Swapping II
- hdu 2830 Matrix Swapping II
- hdu 2830 Matrix Swapping II
- hdu 2830 Matrix Swapping II
- hdu 2830 Matrix Swapping II
- HDU 2830 Matrix Swapping II
- hdu 2830 Matrix Swapping II
- hdu 2830 - Matrix Swapping II
- HDU 2830 Matrix Swapping II
- Android Bitmap内存优化
- 《设计模式》- 模板模式
- hibernate学习:CRUD单元测试用例+知识总结
- 呵呵...
- Java 反射机制浅析
- Matrix Swapping II
- 哈夫曼树(huffmTree)
- Repeated DNA Sequences [leetcode]
- JAVABEAN是什么和总结JAVABEAN的两种使用方式
- OpenSUSE 13.2开发环境配置
- 《战略的智慧》,读了一半
- 解决iOS8下面UItableView里面的cell多分割线右移的问题
- hdu 5007 水题
- js 解析URL 的参数