poj 3176 Cows Bowling
来源:互联网 发布:灯具数据图 编辑:程序博客网 时间:2024/06/05 05:32
简单动态规划
/*PROG:LANG: C++11 */#include <cstdio>#include <cmath>#include <cstring>#include <string>#include <cstdlib>#include <climits>#include <ctype.h>#include <queue>#include <stack>#include <vector>#include <utility>#include <deque>#include <set>#include <map>#include <iostream>#include <fstream>#include <algorithm>#include <time.h>using namespace std;#define mst(a,b) memset(a,b,sizeof(a))typedef long long ll;typedef pair<int, int> P;const ll MOD = 1000000007;const int INF = 0x7fffffff;const int MAXN = 401;int matrix[400][400];int n;int main(){ cin >> n; for(int i = 0; i < n; i++) for(int j = 0; j <= i; j++) cin >> matrix[i][j]; for(int i = n-2; i >= 0; i--) for(int j = 0; j <= i; j++) matrix[i][j] = matrix[i][j] + max(matrix[i+1][j], matrix[i+1][j+1]); cout << matrix[0][0] << endl; return 0;}
0 0
- poj 3176 Cows Bowling
- POJ 3176 COW BOWLING
- POJ 3176 Cow Bowling
- poj 3176 Cow Bowling
- POJ 3176 Cow Bowling
- Poj 3176 Cow Bowling
- POJ 3176 Cow Bowling
- poj 3176 Cow Bowling
- poj 3176 Cow Bowling
- POJ 3176 Cow Bowling
- POJ 3176 Cow Bowling
- poj 3176 cow bowling
- POJ 3176 Cow Bowling
- POJ 3176 Cow Bowling
- POJ 3176 Cow Bowling
- poj 3176 Cow Bowling
- poj 3176 Cow Bowling
- POJ 3176 Cow Bowling
- Apache Shiro
- Linux 命令行更新android sdk
- Android中arrayAdapter的使用
- 安全系统简介
- xUtils - android工具库,大量更新:bug修复,缓存优化,GET请求加入lru缓存。
- poj 3176 Cows Bowling
- Xcode6 和 Cocos2dx3.1以下版本的不兼容问题
- ubuntu12.04 samba服务器配置
- iOS Category的简单使用
- C语言实现的list -- 源码摘自wine
- Linux C 多线程执行顺序问题
- 记得有一个爱你
- append和appendTo
- 60个开发者不容错过的免费资源库