HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Contests > CEN303 2013-15 Questions > problem:


15PrE-10. 50816 - Largest Sum Path

CEN303 2013-15 Questions

Start: Dec.15.2013 at 02:00:00 PM
Finish: Dec.15.2013 at 07:00:00 PM
The contest is finished!
• Contest scoreboard

Guest
• Review clarifications (1)

Contest problems

• 15HW-30. 50828 - Arranging Time ...
• 15HW-40. 50676 - Cinema Millennium
• 15HW-40. 50829 - Decode an Image
• 15HW-50. 50830 - Sorting BST Nodes
• 15HW-60. 50678 - The Jumping Rabbit
• 15MdE-10. 50802 - Comparing Exams
• 15MdE-20. 50803 - Sum of the dept...
• 15MdE-40. 50805 - Sum of the weig...
• 15PrE-10. 50816 - Largest Sum...
• 15PrE-20. 50817 - The Knight Move
• 15PrE-30. 50818 - Depth Limited BST
• 15PrE-40. 50819 - Linked Numbers
• 15PrE2-01. 50847 - The first m train...
• 15PrE2-06. 50837 - Sum is equal to K
• 15Rst-10. 50857 - Nine-Stones Game
• 2.15FE-03. 50996 - Checkers - the ...

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
Question by Ibrahim Mesecan.

Largest Sum Path

Path sum is the sum of the numbers on a path in BST. For example the sum of the numbers

  15 + 12 + 14 + 13 = 54
is the largest path sum according to the given BST.

Question: Write a program to find the largest path sum in a given BST.

Input specification
In the first line, you will be given an integer (n) The number of numbers in the BST where 0 ≤ n ≤ 1e4. Then, in the following n lines, you will be given n integers which are between -1e4 and 1e4.

Output specification
Show one number: Largest path sum.

Sample Input I
10
15
17
15
12
14
12
16
1
17
13
Sample Output I
54



Для отправки решений необходимо выполнить вход.

www.contester.ru