ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Турниры > CEN303 2013-15 Questions > задача:


14-Fall2-40. 50772 - The Path of a Node

CEN303 2013-15 Questions

Старт: 15.дек.2013 в 14:00:00
Финиш: 15.дек.2013 в 19:00:00
Турнир завершён!
• Турнирная таблица

Гость
• Вопросы к жюри (1)

Задачи турнира

• 14-Fall1-20. 50750 - Service Time - 2
• 14-Fall1-30. 50771 - BST Level Sum
• 14-Fall1-40. 50683 - Te Parkojme A...
• 14-Fall1-50. 50770 - Average Depth
• 14-Fall1-60. 50784 - Top Growing C...
• 14-Fall2-10. 50751 - The biggest Mi...
• 14-Fall2-20. 50794 - Writing Files Int...
• 14-Fall2-30. 50490 - Across the River
• 14-Fall2-40. 50772 - The Path o...
• 14-Fall2-50. 50681 - Center of a Series
• 14-FallResit-10. 50525 - Ordering Pizza
• 14-FallResit-20. 50488 - Connecting...
• 15FE-01. 50851 - Repeated Numbers
• 15FE-01. 50838 - Balanced Numbers
• 15FE-04. 50997 - Dynamic Knights
• 15HW-10. 50826 - Olive Containers
• 15HW-30. 50828 - Arranging Time ...

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
Question by Ibrahim Mesecan.

The Path of a Node

Question: You will be given a series of integers. And, you are asked to place them into a binary search tree. Write a program that is going to show the path to a given node by using characters:

  • "S" for start (or the root),
  • "L" for left, or
  • "R" for right

Input specification
In the first line you will be given two integers (n and num). Then in the following lines you will be given n integers where the numbers are between -20000 and +20000 and n is between 1 and 40000.
Note: There are at most 25 numbers in every line and the numbers are separated by space.

Output specification
If the searching number exists in the tree, show the path to the node given by num. Otherwise, show the message "Not in the list"

Sample Input I
6 6
4 7 3 2 6 3
Sample Input II
6 9
4 7 3 2 6 3
Sample Output I
SRL
Sample Output II
Not in the list


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

www.contester.ru