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 1100. Final Standings

What should I output?
Posted by Valentin Mihov 30 Nov 2001 11:04
If I have this input
3
2 3
3 4
5 4

Is there any difference between outputing
5 4     3 4
3 4 and 5 4
2 3     2 3
Yes. The author of the problem stresses that your program should output the same result as that you would get by using bubble sort - see the end of the problem text (or read this message)
Posted by shitty.Mishka 1 Dec 2001 02:11
> If I have this input
> 3
> 2 3
> 3 4
> 5 4
>
> Is there any difference between outputing
> 5 4     3 4
> 3 4 and 5 4
> 2 3     2 3
Bubble sort works following way:
while (exists A[i] and A[i+1] such as A[i] < A[i+1]) do
   Swap(A[i], A[i+1]);

So, the correct output is
3 4
5 4
2 3