ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1082. Gaby Ivanushka

The solution is just printing 1,2,...,n, but how did you think it out?
Posted by Maigo Akisame 10 Jun 2004 18:13
Re: The solution is just printing 1,2,...,n, but how did you think it out?
Posted by Yosif Yosifov 10 Jun 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?
Posted by Fokysnik 31 Jul 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?
Posted by AlainDelon 23 Dec 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?
Posted by Samer Abdulamer 13 Apr 2022 12:29
Re: The solution is just printing 1,2,...,n, but how did you think it out?
Posted by Samer Abdulamer 13 Apr 2022 12:29
Re: The solution is just printing 1,2,...,n, but how did you think it out?
Posted by Samer Abdulamer 13 Apr 2022 12:29