从上到下枚举行,可以$O(m)$更新现在每一列往上连续的1的个数,也可以在$O(m)$的时间内完成排序。总复杂度$O(nm)$。

#include<cstdio>
#define M 1510
int n,m,x,i,j,b[M],ans,q[2][M],t;char a[M];
int main(){
for(scanf("%d%d",&n,&m),gets(a),i=1;i<=m;i++)q[0][i]=i;
for(x=i=1;i<=n;i++,x^=1){
gets(a+1);
for(j=1;j<=m;j++)if(a[j]=='1')b[j]++;else b[j]=0;
for(t=0,j=1;j<=m;j++)if(b[q[x^1][j]])q[x][++t]=q[x^1][j];
for(j=1;j<=m;j++)if(!b[q[x^1][j]])q[x][++t]=q[x^1][j];
for(j=1;j<=m;j++)if(ans<j*b[q[x][j]])ans=j*b[q[x][j]];
}
return printf("%d",ans),0;
}

  

BZOJ1768 : [Ceoi2009]logs的更多相关文章

  1. bzoj AC倒序

    Search GO 说明:输入题号直接进入相应题目,如需搜索含数字的题目,请在关键词前加单引号 Problem ID Title Source AC Submit Y 1000 A+B Problem ...

  2. 微软发布TX(LINQ To Logs And Traces)

    微软开源技术公司于发布了Tx,这是一个Apache 2协议的开源项目,可以使用日志/跟踪文件辅助调试,以及创建实时监控和告警系统. 下面是几个引人关注的功能-- 允许在原始事件源上使用LINQ 允许在 ...

  3. CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.

    今天,在用icinga服务器端测试客户端脚本时,报如下错误: [root@mysql-server1 etc]# /usr/local/icinga/libexec/check_nrpe -H 192 ...

  4. Android Gradle Build Error:Some file crunching failed, see logs for details解决办法

    转载请标明出处: http://www.cnblogs.com/why168888/p/5925756.html 本文出自:[Edwin博客园] 错误日志:Error:java.lang.Runtim ...

  5. MS SQL错误:SQL Server failed with error code 0xc0000000 to spawn a thread to process a new login or connection. Check the SQL Server error log and the Windows event logs for information about possible related problems

          早晨宁波那边的IT人员打电话告知数据库无法访问了.其实我在早晨也发现Ignite监控下的宁波的数据库服务器出现了异常,但是当时正在检查查看其它服务器发过来的各类邮件,还没等到我去确认具体情 ...

  6. 屏蔽zencart logs文件夹下不断生成的日志文件

    在根目錄下的logs文件夾中,經常生成一些錯誤文件類似myDEBUGxxxxx.log這樣的錯誤文件(而且這樣的錯誤文件由來并非網站出現什麽嚴重不可挽救的錯誤,大部分是一些未定義變量這樣的不起眼的小錯 ...

  7. Error:Execution failed for task ':app:mergeDebugResources'. > Some file crunching failed, see logs f

    今天调试安卓程序遇到的问题Error:Execution failed for task ':app:mergeDebugResources'. > Some file crunching fa ...

  8. (error) MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis logs for details about t

    运行redis过程中,突然报错如下: (error) MISCONF Redis is configured to save RDB snapshots, but is currently not a ...

  9. System.Security.SecurityException The source was not found, but some or all event logs could not be searched.Inaccessible logs Security.

    An exception occurred during the Install phase. System.Security.SecurityException The source was not ...

随机推荐

  1. 【DS】排序算法之选择排序(Selection Sort)

    一.算法思想 选择排序是一种简单直观的排序算法.它的工作原理如下: 1)将序列分成两部分,前半部分是已经排序的序列,后半部分是未排序的序列: 2)在未排序序列中找到最小(大)元素,放到已排序序列的末尾 ...

  2. Linux命令(五)免密码远程登录和配置别名

    1. ssh-keygen 2. ssh-copy-id -p port user@remote .ssh中建立并编辑config文件 原来需要 ssh -p ubuntu@xxx.xxx.xxx 现 ...

  3. nodejs安装zmq出错

    想用zmq来做进程间通信,在Windows下.Centos下安装成功.记录如下: 一.Windows安装zmq 直接 npm install zmq  成功就成功. 不成功的话估计是报"未能 ...

  4. HDU 1308 What Day Is It?(模拟题)

    解题报告:输入一个年月日,让你求出那一天是星期几,但是做这题之前必须先了解一点历史.首先在1582年之前,判断是否是闰年的标准是只要能被四整除就是闰年, 然后在1752年9月2号的后的11天被抹去了, ...

  5. 第6月第6天 opengles 三角形

    1. http://blog.csdn.net/u010963658/article/details/52691578 2.多张图 https://www.oschina.net/question/2 ...

  6. Python 入门基础8 --函数基础1 定义、分类与嵌套使用

    目录 零.了解函数 一.函数的组成 二.函数的定义 三.函数的使用 四.函数的分类 五.函数的嵌套使用 零.了解函数 1.什么是函数 在程序中函数就是具备某一功能的工具 2.为何用函数 为了解决以下问 ...

  7. Javascript - Vue - 请求

    本地增删查的一个例子 <div id="box">    <div class="panel panel-primary">       ...

  8. 内存对齐与ANSI C中struct型数据的内存布局 【转】

    转自:http://blog.chinaunix.net/uid-25909619-id-3032209.html 当在C中定义了一个结构类型时,它的大小是否等于各字段(field)大小之和?编译器将 ...

  9. 基于 Apache 在本地配置多个虚拟主机

    如何使用 Apache 在本地配置出多个虚拟主机呢?而且使用不同的“域名”来访问本地不同的站点呢? 一般情况下,咱们都使用 localhost 来访问本机上的服务器,在我们的 C:/WINDOWS/s ...

  10. 移动端调试工具---vConsole

    vConsole:https://github.com/Tencent/vConsole/blob/dev/README_CN.md 使用方法: 使用npm进行安装: npm install --sa ...