[noip2008] 传纸条
来源:互联网 发布:苹果mac os系统 编辑:程序博客网 时间:2024/04/30 09:33
题目链接
题解:多进程dp
#include <iostream>#include <cstdio>using namespace std;const int M=55;int n,m;short map[M][M];short f[M][M][M][M];inline void pd(int &s,int x){ if(s<x) s=x;}void init(){ cin>>n>>m; for(int i=1;i<=n;i++) for(int j=1;j<=m;j++) scanf("%d",&map[i][j]);}void work(){ for(int i=1;i<=n;i++) for(int j=1;j<=m;j++) for(int l=1;l<=n;l++) for(int k=1;k<=m;k++) { int s=f[i][j][l][k]; pd(s,f[i-1][j][l-1][k]); pd(s,f[i-1][j][l][k-1]); pd(s,f[i][j-1][l-1][k]); pd(s,f[i][j-1][l][k-1]); s+=map[i][j]; if(i!=l&&j!=k) s+=map[l][k]; f[i][j][l][k]=s; } printf("%d\n",f[n][m][n][m]);}int main(){ init(); work(); return 0;}
0 0
- noip2008 传纸条
- 【DP】[NOIP2008]传纸条
- [NOIP2008]传纸条
- Noip2008传纸条题解
- 【NOIP2008】传纸条题解
- NOIP2008 传纸条
- 【NOIP2008】传纸条
- NOIP2008传纸条
- [noip2008] 传纸条
- NOIP2008 传纸条
- NOIP2008-03-传纸条
- [NOIP2008]传纸条【多维DP】
- 【noip】noip2008 wikioi1169传纸条
- [NOIP2008] 传纸条-解题报告
- 洛谷P1006&NOIP2008 传纸条
- NOIP2008提高组 传纸条
- noip2008 传纸条 T3题解
- 【提高组NOIP2008】传纸条
- 获取Android源码
- Technocup 2017 - Elimination Round 1 C. Guess the Array (交互题)
- labview myRIO驱动mpu6050
- 音频封装格式——AAC
- Android Studio 各类使用技巧集合(【非原创留用】)
- [noip2008] 传纸条
- poj 2632 Crashing Robots (模拟题)
- svn命令下载资源到liunx目录上
- [Usaco08Oct] Watering Hole
- 生命的力量
- 【NOIP 模拟题】[T2] 王者荣耀(二分答案+dp)
- Mysql 5.7.9以上版本 设置账户密码及授权
- Linux-CentOS6.7——安装Samba服务器
- HBase0.94和Hadoop2 结合