HDU2845
来源:互联网 发布:怎么复制筛选后的数据 编辑:程序博客网 时间:2024/05/18 10:24
#include <iostream>#include <cstdio>#include <algorithm>#include <cstring>using namespace std;int l,r;int s[10005][10005];int dp1[200005],dp2[200005];int main(){ while(scanf("%d%d",&l,&r)!=EOF) { for(int i=2; i<l+2; i++) { for(int j=2; j<r+2; j++) { scanf("%d",&s[i][j]); //dp[i][j] = s[i][j]; } } int Max_ = -1; for(int i=2; i<l+2; i++) { //int max_ = -1; for(int j=2; j<r+2; j++) { dp1[j] = max(dp1[j-1],dp1[j-2]+ s[i][j]) ; //max_ = max (max_ , dp1[j]); } dp2[i] = max(dp2[i-1],dp2[i-2]+dp1[r+1]); //Max_ = max(dp2[i],Max_); } cout << dp2[l+1] << endl; } return 0;}
阅读全文
0 0
- hdu2845
- hdu2845
- HDU2845
- hdu2845
- hdu2845 Beans
- HDU2845--Beans
- hdu2845 Beans (%)
- HDU2845-Beans
- hdu2845之Beans,DP
- hdu2845 简单dp
- hdu2845——Beans
- HDU2845 Beans(DP)
- hdu2845 Beans--DP
- hdu2845 Beans(DP)
- hdu2845—Beans(dp)
- ACM 学习感悟——HDU2845
- hdu2845二分图 Hopcroft-Karp Algorithm
- hdu2845 Beans (最大不连续子序列和)
- 《UNIX网络编程 卷1》 笔记: 线程
- caffe中的优化方法
- C# 中调用dll
- Windwos Install PacketiX VPN 4.0 Server
- ABAP 对内表数据下载到EXCEL的几种方法
- HDU2845
- Android6.0/7.0/O的新特性
- opencv学习笔记
- linux下挂载U盘
- BZOJ-1042 [HAOI2008]硬币购物 容斥原理 +01背包方案数
- 面试题4. 替换空格
- protobuf入门:二
- 1023. 组个最小数 (20)
- win32学习01.编程基础