ENG  RUSTimus Online Judge
Online Judge
Задачи
Авторы
Соревнования
О системе
Часто задаваемые вопросы
Новости сайта
Форум
Ссылки
Архив задач
Отправить на проверку
Состояние проверки
Руководство
Регистрация
Исправить данные
Рейтинг авторов
Текущее соревнование
Расписание
Прошедшие соревнования
Правила
вернуться в форум

Обсуждение задачи 1082. Иванушка-дурачок

Because the procedure P is sorting .
The tsar's program is quicksort algorithm
it sorts input array and counts in how many swaps it was done (variable c)(not exact value but represents it)...
Just try to think about variable c and you will realize that.
So the solution is to print not only 1,2,...,n but
ANY SORTED ARRAY OF LENGTH N
I resolve it by recursively fill the whole array.

And I think out sorted array because I think it is easier to make the array sorted(since then the quicksort become bubble sort).