АВТ
Language:

Remote Training on Programming

Problems On-line status Contests FAQ
For authors:
Register  ||  Login
 
Hello, Guest! Login or register.

153. Double Sorting

Time Limit: 1 seconds
Memory Limit:64000KB
Points:2
View Problem Statistics Submit Problem added Administrator

Двойная сортировка.

Вводится одномерный массив с клавиатуры. Необходимо упорядочить числа с четными индексами (индексы начинаются с “0”) по возрастанию, а числа с нечетными индексами по убыванию. Количество элементов не больше 10.

Входные данные

Количество элементов исходного массива.
Исходный массив, записанный в одну строку, элементы которого раделены пробелом.

Выходные данные

Результирующий массив в одну строку, элементы разделены пробелом. 

Пример входных данных

5
1 3 5 7 9
2 4 6 8 10

Пример выходных данных

3 -1 7 -1 11 -1 15 -1 19 -1 
Автор: Барламов А.Г. aka SpIInner

View Problem Statistics Submit Author/source:
Educational Courses / Programming and Basics of Algorithmization / Arrays /
121. Cyclic Permutation 153. 151. Inserting element into array 150. Inserting into array 155. Permutation of Elements in Array
We can all benefit by doing occasional "toy" programs, when artificial restrictions are set up, so that we are forced to push our abilities to the limit. The art of tackling miniproblems with all our energy will sharpen our talents for the real problems. Donald E. Knuth.
time generating 0.141 sec.
© Copyright VSTU, AVT, Nosov D.A.