IOM 2020, Блиц — Задача 76

The Blitz-contest of IOM-2020

Условие

What is the result of the following program?

s = ’1’*99while s.find(’111’) >= 0:s = s.replace(’111’,’22’)s = s.replace(’222’,’11’)print(s)\begin{array}{l}\texttt{s = '1'*99}\\ \texttt{while s.find('111') >= 0:}\\ \quad \texttt{s = s.replace('111','22')}\\ \quad \texttt{s = s.replace('222','11')}\\ \texttt{print(s)}\end{array}

Отговори

Решение

Внимание: Непълно решение

The source contains only the answer key, no worked solution.


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