POJ 1050 To the Max
来源:互联网 发布:黄金软件 编辑:程序博客网 时间:2024/05/29 13:17
首先感谢:传送门:http://blog.csdn.net/sj13051180/article/details/6667577
提供的思路(不懂得去看吧);
代码是自己的
#include<iostream>#include<string.h>using namespace std;int a[110][110],b[110][110];int main(){int N;cin>>N;memset(a,0,sizeof(a));memset(b,0,sizeof(b));int sum=0;for(int i=1;i<=N;i++) for(int j=1;j<=N;j++) cin>>a[i][j];int maxium=-128;for(int h=1;h<=N;h++){ memset(b,0,sizeof(b)); for(int i=h;i<=N;i++) { sum=0; for(int j=1;j<=N;j++){ b[h][j]+=a[i][j]; //cout<<b[i][j]<<endl;} for(int z=1;z<=N;z++){if(sum<=0){sum=b[h][z];}else{sum+=b[h][z];}if(sum>maxium){maxium=sum;}} }} cout<<maxium<<endl;return 0; }
阅读全文
0 0
- POJ 1050 To the Max
- poj 1050 To the Max
- POJ 1050 To the Max
- poj 1050 To the Max
- Poj 1050 To the Max
- POJ 1050 To the Max
- POJ 1050 To the Max
- POJ 1050 To the Max
- poj 1050 To the Max
- poj 1050 To the Max
- Poj 1050 To the Max
- POJ 1050 To the Max
- poj 1050 to the max
- POJ 1050 To the Max
- poj 1050 to the max
- poj-1050- To the Max
- POJ-1050-To the Max
- POJ 1050 To the Max
- 文件系统的特殊权限以及ACL的相关用法
- 截图,草图,便签,最近应用
- STL容器map的下标运算符[]
- Android 7.0 Settings Summary 小记
- oracle 服务器类的安装 服务设置 连接数据库
- POJ 1050 To the Max
- Java Web项目中解决中文乱码方法总结
- 001-配置JDK环境变量
- AVUpate编译
- UESTC 2017 Summer Training #16 Div.2(亚洲之旅)
- 分页查询案例
- 图片先垫底图,加载出来以后替换真图的方法
- PAT乙级 1068. 万绿丛中一点红(20)
- 【南阳 oj 】2--括号配对问题(栈)