IOM 2021, Блиц — Задача 45

The Blitz-contest of IOM-2021

Условие

For which initial nonnegative value of ss does the following code output 0?

Python code listing (printed as an image), six lines: jump = [2, 3, 1, 4, 5, 9, 0, 6, 8, 7]; an outer loop for _ in range(len(jump) - 1) containing an inner loop for _ in range(4) that sets s = jump[s], followed (inside the outer loop) by jump[s] = jump[jump[s]]; after the loops print(s).

Отговори

Решение


Оригинал в Архива: iom-2021-blitz-tasks-eng.pdf · официални решения: iom-2021-blitz-answers-eng.pdf