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

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

The solution is just printing 1,2,...,n, but how did you think it out?
Послано Maigo Akisame 10 июн 2004 18:13
Re: The solution is just printing 1,2,...,n, but how did you think it out?
Послано Yosif Yosifov 10 июн 2004 22:57
Because the procedure P is sorting .
Re: The solution is just printing 1,2,...,n, but how did you think it out?
Послано Fokysnik 31 июл 2006 13:44
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
Re: The solution is just printing 1,2,...,n, but how did you think it out?
Послано AlainDelon 23 дек 2007 18:31
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).
Re: The solution is just printing 1,2,...,n, but how did you think it out?
Послано Samer Abdulamer 13 апр 2022 12:29
Re: The solution is just printing 1,2,...,n, but how did you think it out?
Послано Samer Abdulamer 13 апр 2022 12:29
Re: The solution is just printing 1,2,...,n, but how did you think it out?
Послано Samer Abdulamer 13 апр 2022 12:29