hdu 1081 To The Max
来源:互联网 发布:统计数据软件 编辑:程序博客网 时间:2024/05/18 01:38
http://acm.hdu.edu.cn/showproblem.php?pid=1081
#include <cstdio>#include <cstring>#include <algorithm>#define maxn 300using namespace std;const int inf=0x7fffffff;int dp[maxn][maxn];int a[maxn][maxn];int main(){ int n; while(scanf("%d",&n)!=EOF) { for(int i=1; i<=n; i++) { dp[i][0]=0; for(int j=1; j<=n; j++) { scanf("%d",&a[i][j]); dp[i][j]=dp[i][j-1]+a[i][j]; } } int max1=-inf; for(int i=1; i<=n; i++) { for(int j=1; j<=i; j++) { int c=0; for(int k=1; k<=n; k++) { c+=(dp[k][i]-dp[k][j-1]); if(max1<c) max1=c; if(c<0) c=0; } } } printf("%d\n",max1); } return 0;}
0 0
- HDU 1081 To the Max
- HDU 1081 To The Max
- HDU 1081 To The Max
- hdu 1081 To The Max
- hdu 1081 to the max
- hdu 1081 To The Max
- hdu 1081 To The Max
- hdu 1081 To The Max
- hdu 1081 To The Max
- HDU 1081 To The Max
- hdu 1081 To The Max
- hdu 1081 To The Max
- hdu 1081 To The Max
- HDU 1081 To The Max
- hdu 1081 To The Max
- HDU 1081 To The Max
- hdu 1081 To The Max
- HDU 1081 To The Max
- iOS study Day14-浅复制
- VC维度
- 已超过传入消息(65536)的最大消息大小配额。若要增加配额,请使用相应绑定元素上的 MaxReceivedMessageSize 属性。
- sys登陆Oracle时Insufficient Privilege
- Android targetSdkVersion详解
- hdu 1081 To The Max
- cookie跨域与p3p协议
- 【Unix 网络编程】服务器网络编程模型——I/O复用:select 函数
- opencv概述及安装步骤
- 【大话QT之二】QuaZip实现多文件打包
- 配置文件自动重新加载
- 第5周作业-字体设置
- 黑马程序员——Java学习笔记之10——“银行业务调度系统”
- Maven项目管理实战(六)--完成单元测试