a991: [橙]The Triangle
Tags :
Accepted rate : 14人/14人 ( 100% ) [非即時]
評分方式:
Tolerant

最近更新 : 2023-04-01 09:48

Content
            7
          3   8
        8   1   0
      2   7   4   4
    4   5   2   6   5   (Figure 1)

Figure 1 shows a number triangle. Write a program that calculates the highest sum of numbers 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.
  • The number of rows in the triangle is >1 but <=100.
  • The numbers in the triangle, all integers, are between 0 and 99.
Input

Data about the number of rows in the triangle are first

Output

The highest sum is written as an integer.

Sample Input #1
5
7
3 8
8 1 0 
2 7 4 4
4 5 2 6 5
Sample Output #1
30
測資資訊:
記憶體限制: 64 MB
不公開 測資點#0 (16%): 1.0s , <1K
不公開 測資點#1 (16%): 1.0s , <1K
不公開 測資點#2 (17%): 1.0s , <1K
不公開 測資點#3 (17%): 1.0s , <1M
不公開 測資點#4 (17%): 1.0s , <1M
不公開 測資點#5 (17%): 1.0s , <1M
Hint :
Tags:
出處:
IOI 1994 [管理者:
lamkinun@gma... (Kinda Lam)
]


ID User Problem Subject Hit Post Date
沒有發現任何「解題報告」