1.5 numtri
来源:互联网 发布:landsat8数据怎么处理 编辑:程序博客网 时间:2024/04/28 21:49
Number Triangles
Consider the number triangle shown below. Write a program that calculates the highest sum of numbers that can be passed on a route that starts at the top and ends somewhere on the base. Each step can go either diagonally down to the left or diagonally down to the right.
7
3 8
8 1 0
2 7 4 4
4 5 2 6 5
In the sample above, the route from 7 to 3 to 8 to 7 to 5 produces the highest sum: 30.
PROGRAM NAME: numtri
INPUT FORMAT
The first line contains R (1 <= R <= 1000), the number of rows. Each subsequent line contains the integers for that particular row of the triangle. All the supplied integers are non-negative and no larger than 100.
SAMPLE INPUT (file numtri.in)
5
7
3 8
8 1 0
2 7 4 4
4 5 2 6 5
OUTPUT FORMAT
A single line containing the largest sum using the traversal specified.
SAMPLE OUTPUT (file numtri.out)
30
- 1.5 numtri
- USACO 1.5.1 numtri
- USACO 1.5 numtri
- usaco 1.5.1 numtri
- section 1.5 numtri
- USACO 1.5 Number Triangles (numtri)
- usaco 1.5 numtri 2008.5.6
- usaco numtri
- usaco numtri
- usaco numtri
- usaco——numtri
- numtri-section1.5
- USACO numtri 数塔问题
- USACO1.5.1 Number Triangles (numtri)
- USACO1.5.1 Number Triangles (numtri)
- 数塔问题(numtri.pas/c/cpp)
- 1.5
- 1.5
- JAVA程序员基本功:开发实现类隐藏及应用
- htc 6800驱动在那下载?
- 随想
- 正式入住csdn博客,
- Delphi从路径取得文件名的简易方法
- 1.5 numtri
- 小故事大道理
- WDM驱动之IRP处理:取消IRP
- CImage::Create()创建png图像和设置黑色像素
- 92wine.com红酒团购网盘点四种葡萄酒投资方式
- Java中的浅拷贝和深拷贝
- JQuery 常用方法基础教程
- Ubuntu 10.x下安装go语言开发环境
- MSSQL 自寫函數