IOM 2018, Блиц, английски — Задача 60
OLYMPIAD OF METROPOLISES. Moscow, September 3 · 3 септември 2018 г.
Условие
What should be the value of in the input in order to get 20 as the output?
![Python program listing with line numbers 1 to 12: def mystery(k, ar, p) loops while k < len(ar) - 1, swaps ar[k] and ar[k + 1] by additions and subtractions when ar[k] > ar[k + 1] and resets k to 0, otherwise increments k, and returns a[p] + a[p - 1]; then p = int(input()), ar = [15, 20, 2, 5, 18] and print(mystery(0, ar, p)).](https://pub-43290baaaff14857b5dd59610ea438c7.r2.dev/problems/iom-2018-blitz/p60-fig1.png)
Отговори
- 2
Решение
Answer: 2
Оригинал в Архива: blitz.pdf · официални решения: blitz-answers.pdf