HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Contests > CEN303_2016Questions > problem:


RE2. 51080 - Deepest Point

CEN303_2016Questions

Start: Oct.28.2016 at 05:00:00 PM
Finish: Nov.01.2016 at 05:00:00 AM
The contest is finished!
• Contest scoreboard

Guest
• Review clarifications (2)

Contest problems

• HW112. 50698 - Ayran Delivery
• PE11. 51023 - Preparing Keyword I...
• PE12. 50835 - Club Presidency
• PE13. 51024 - Total Stock Price
• PE14. 50998 - CEN112 Homework, ...
• PE21. 51071 - Phalanx-2
• PE22. 51072 - Castle on chessboard
• RE1. 51079 - Key person - 2
• RE2. 51080 - Deepest Point

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.

Deepest Point

Question: You are given a source vertex and an edge list for a graph. Write a program that finds the height of the deepest point in the tree starting from the given source vertex.

Input specification: In the first line, you are given number of vertices (n), the number of edges (e) and the start vertex (src). In the following n lines you will have pairs of numbers (a,b) which represents an edge between the vertices a and b and 1 ≤ (a, b) ≤ n ≤ 250 and 0 ≤ e ≤ 5,000. Note: Assume that height of the root is 0.

Output specification: Show one integer: the depth of the deepest leaf.

Sample Input Sample Output
14 14 1
11 13
1 12
1 2
1 11
12 5
4 3
4 12
2 7
7 6
7 8
8 14
13 10
1 14
13 9
4



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

www.contester.ru