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

Разделы > Рекурсия > задача:


50389 - Reverse an Array

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

Задачи раздела

• 50724 - Number of Circles
• 50729 - Max number in 2D array
• 50928 - War Of Battleships
• 50577 - Numrat perfekte dhe numra...
• 50725 - Fibonacci Series
• 50370 - Number of rectangles in a ...
• 50376 - Sequences
• 50421 - Repairing road segments
• 50389 - Reverse an Array
• 50727 - Fibonacci Numbers
• 50726 - Pascal Triangle - 1
• 50475 - Voice advertising
• 50721 - Palindroma

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

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

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

Reverse an Array

Question:
You will be given n numbers. Reverse the elements in the positions a through b.

Input specification
In the first line, you will be given three numbers (n, a and b). Then, in the following line, you will be given comma-separated n integers which are between -10000 and 10000 where n is between 1 and 10000 and 1 ≤ a ≤ b ≤ n.
Note: Assume that the number positions are from 1 to n.

Output specification
After reversing the numbers in the positions a through b, show all the numbers (show numbers by separating spaces).

Sample Input I   
  8 6 7
  -2, 3, 3, 6, 5, 3, 9, -7,
Sample Input II   
  10 3 5
  5, -7, 3, 4, 5, 6, 7, -8, 2, 9,
Sample Output I   
  -2 3 3 6 5 9 3 -7
Sample Output II   
  5 -7 5 4 3 6 7 -8 2 9


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

www.contester.ru