HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Data Structures > problem:


50695 - Longest link between neurons

Guest
• Review clarifications (1)

Volume problems

• 50796 - KNN
• 50340 - Game 19
• 50735 - Top M Products
• 50697 - Base Stations
• 50383 - Noisy Mornings
• 50479 - Bit Compressor
• 50674 - Collecting Eggs
• 50486 - Problems and Programmers
• 50695 - Longest link between n...
• 50411 - Sum of the Leaves
• 50677 - The Cottage
• 50795 - Trunk
• 50414 - Traffic
• 50698 - Ayran Delivery
• 50978 - Albanian Coders
• 50699 - Fighting Vampires
• 50830 - Sorting BST Nodes

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 Osman Ay.

Longest link between neurons

Ms. Xhani works in a hospital as neurologist. A neuron is an electrically excitable living cell that processes or transmits information through electrical and chemical signals. These signals between neurons occur via synapses, specialized connections with other cells. For her research, she is trying to identify the points over the brain and the connections between them. She has identified around 2500 points on the brain and around 6000 neurons linking them. She works on how these neurons communicate. One neuron can have many inputs from many different synapses and these links are not two directional. She needs to identify the longest connection between the given points.

Question: Write a program that is going to find out the longest link starting from a given point.

Input specification
At the beginning, you will be given 3 integers;

  • Number of points (V): an integer between 1 and 2500
  • Number of neurons (linke) (E): an integer between 1 and 6000
  • Starting point: an integer between 1 and 2500
Then in the following E lines you will be given two integers where there is a link between from the first point to the second.

Output specification
Show one integer: The length of the longest link.

Sample Input I
8 6 4
1 5
7 6
4 1
2 7
4 2
4 3
Sample Output I
3



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

www.contester.ru