从上到下枚举行,可以$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. html5 canvas多个图像旋转

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  2. 有关楼层滚动且对应楼层Nav导航高亮显示

    $(document).ready(function(e) { //定义数组,储存楼层距离顶部的高度(floorsTop) var floorsTop=[]; function floorsTopF( ...

  3. 20155217 2016-2017-2 《Java程序设计》第5周学习总结

    20155217 2016-2017-2 <Java程序设计>第5周学习总结 教材学习内容总结 第八章 java中所有错误都会被包装为对象,可以尝试(try)执行程序并捕捉(catch)代 ...

  4. 爬虫笔记之w3cschool注册页面滑块验证码破解(巨简单滑块位置识别,非鼠标模拟轨迹)

    一.背景介绍 最开始接触验证码破解的时候就是破解的w3cschool的使用手机号找回密码页面的验证码,详见:验证码识别之w3cschool字符图片验证码(easy级别),这次破解一下他们注册页面的滑块 ...

  5. windows常用设置

    1.截图   A.QQ打开,ctrl + Alt + A   B. cmd 输入  截图工具 2.录制windows操作步骤    命令行输入:psr.exe

  6. 【转载】Maven pom文件详解

    什么是pom?    pom作为项目对象模型.通过xml表示maven项目,使用pom.xml来实现.主要描述了项目:包括配置文件:开发者需要遵循的规则,缺陷管理系统,组织和licenses,项目的u ...

  7. linux下简单的备份的脚本 2 【转】

    转自:http://blog.chinaunix.net/xmlrpc.php?r=blog/article&uid=26807463&id=4577034 之前写过linux下简单的 ...

  8. mac lsof使用查看端口

    安装 brew install lsof 在Mac OS系统中,无法使用netstat来查看端口占用情况,可以使用lsof来代替,这种方式在Linux下也适用. sudo lsof -nP -iTCP ...

  9. (转载)ibatis:解决sql注入问题

    原文地址:http://blog.csdn.net/scorpio3k/article/details/7610973 对于ibaits参数引用可以使用#和$两种写法,其中#写法会采用预编译方式,将转 ...

  10. 虚拟机 VMware安装系统,提示此主机支持Intel VT-x,但Intel VT-x处于禁用状态

    VMware提示此主机支持Intel VT-x,但Intel VT-x处于禁用状态 VMware提示此主机支持Intel VT-x,但Intel VT-x处于禁用状态这是怎么回事呢? Intel VT ...