IOM 2017, Блиц — Задача 30
OLYMPIAD OF METROPOLISES. Moscow, September 4 · 4 септември 2017 г.
Условие
Array A has 6 numbers indicating the daily maximum temperatures in Shanghai in a period of time:
a[1] a[2] a[3] a[4] a[5] a[6] .
Array A is going to be sorted in descending order, and bubble sort algorithm that compares two adjacent numbers from right to left is going used. What is the value of the fourth element in Array A after the second round of data processing.
During the k-th round of data procession, assuming there are n elements, first we compare the (n-1)-th and n-th element and swap them if necessary, then (n-2)-th and (n-1)-th, etc. and at the end of the k-th round we compare and swap the k-th and the (k+1)-th element.
Отговори
- 33
Решение
Answer: 33
Оригинал в Архива: blitz.pdf · официални решения: answers-blitz.pdf