hdu 2830 Matrix Swapping II
来源:互联网 发布:kali linux ddos攻击 编辑:程序博客网 时间:2024/04/30 11:35
题目:http://acm.hdu.edu.cn/showproblem.php?pid=2830
又是和1505一个类型的。。。
下面是AC代码:
#include <iostream>using namespace std;const int N = 1002;char a; int h[N], hash[N];int n, m;int main(){int max;while (scanf("%d %d", &n, &m) != EOF){int i, j;for (j=0; j<m; j++)h[j] = 0;max = 0;for (i=0; i<n; i++){getchar();for (j=0; j<N; j++)hash[j] = 0; for (j=0; j<m; j++){scanf("%c", &a);if (a == '1')h[j] += 1;elseh[j] = 0;hash[h[j]]++;}int tf=0;for (j=N-2; j>=0; j--){hash[j] += hash[j+1];tf = j*hash[j];if (max < tf)max = tf;}}printf("%d\n", max);}return 0;}
- 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
- 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
- 自动生产程序代码
- 购房基础知识(首次购房一定要看)
- delete 与 delete[]
- Android - 监视数据库的变化
- 黑马程序员-Servlet的细节、ServletConfig对象、ServletContext对象及ServletContext应用
- hdu 2830 Matrix Swapping II
- Linux下批量替换文件内容方法
- 使用javamail发送和接收邮件
- 第四章 规则的命令
- linux那些事之我是U盘 笔记
- 监听手机来电
- Better History:更加精确方便地查看“历史记录”
- 高血压、心脑血管疾病症状、原因及疗法
- pad和phone的整合产品草图