poj3176
来源:互联网 发布:贵金属网络销售技巧 编辑:程序博客网 时间:2024/04/30 11:46
代码如下:
#include<iostream>
using namespace std;
int main()
{
int i,j,n;
int a[350][350];
cin>>n;
for(i=1;i<=n;i++)
for(j=1;j<=i;j++)
cin>>a[i][j];
for(i=n;i>=1;i--)
{
for(j=1;j<i;j++)
{
if(a[i][j]>a[i][j+1])
a[i-1][j]=a[i][j]+a[i-1][j];
else
a[i-1][j]=a[i][j+1]+a[i-1][j];
}
}
printf("%d",a[1][1]);
return 0;
}
第一次用动态规划做题,蛮简单的一道题,发贴纪念一下,,,,,,
- poj3176
- poj3176
- poj3176
- poj3176
- poj3176 dp
- poj3176(DP)
- POJ3176(DP)
- poj3176、poj1163
- poj3176 简单dp
- POJ3176----Cow Bowling
- poj3176 Cow Bowling DP
- 数塔--poj3176
- poj3176 cow bowling
- poj3176 Cow Bowling
- poj3176 Cow Bowling
- poj3176 Cow Bowling
- POJ3176 DP 数塔
- [dp]poj3176 Cow Bowling
- 开始走自己的道路了
- introduction to algorithms 菜鸟笔记 list
- 痛苦的网上购物经历
- Everything Begins In A New Point
- SYBASE中生成所有建表语句的过程
- poj3176
- introduction to algorithms 菜鸟笔记 slist
- 发现一个学习web技术的网站
- insert后获得插入数据的编号
- 怎样向iframe中的表单传值
- introduction to algorithms 菜鸟笔记 sort algorithms
- Windows CE 6.0资源汇总
- 程序员:SOA的企业实践从何而起
- JS去空格的方法