1050 To the Max DP
来源:互联网 发布:搜狗 mac 设置 编辑:程序博客网 时间:2024/06/11 02:34
求最大子矩阵和。
#include <stdio.h>int main(){ int sum[101][101],n,ans=0,tmp; scanf("%d",&n); for (int i=1; i<=n; i++) { sum[i][0]=0; for (int j=1; j<=n; j++) { scanf("%d",&tmp); sum[i][j]=sum[i][j-1]+tmp; } } for (int i=1; i<=n; i++) for (int j=i; j<=n; j++) { tmp=sum[1][j]-sum[1][i-1]; for (int k=2; k<=n; k++) { int temp=sum[k][j]-sum[k][i-1]; tmp=temp>temp+tmp ? temp : tmp+temp; if (tmp>ans) ans=tmp; } } printf("%d\n",ans); return 0;}
- 1050 To the Max DP
- To the Max (DP)
- POJ 1050 To the Max DP
- POJ 1050 To the Max 经典DP
- POJ 1050 To the Max DP
- poj 1050To the Max dp+暴力
- DP训练 POJ-1050 To the Max
- To the Max - POJ 1050 dp
- POJ 1050 To the Max DP题解
- poj - 1050 - To the Max(dp)
- POJ 1050 - To the Max(DP)
- poj-1050-To the Max【DP】
- POJ-1050-To the Max-dp
- POJ 1050 to the max(dp)
- [DP]poj 1050 To the Max
- poj 1050 To the Max (dp)
- 【POJ 1050】To the Max(dp)
- POJ 1050 To the Max(DP)
- 解决“adb.exe已停止工作”的办法
- CodeForces 315E - Sereja and Subsequences 阅读理解+树状数组
- IE诡异bug记录
- 遇到的check the manual that corresponds to your MySQL server version for the right syntax错误
- confirm的使用详解
- 1050 To the Max DP
- POJ 1690 (Your)((Term)((Project))) 水题
- AVAudioPlayer的使用
- java.lang.NoClassDefFoundError: javax.annotation.meta.When.class
- ajax实现点击弹出选择列表
- HOWTO Use the GCC specs file
- cad块无法分解,炸不开怎么办?
- oracle之data guard——物理standby建立
- ajax实现下拉列表级联显示