TSORT - Turbo Sort

Given the list of numbers, you are to sort them in non decreasing order.

Input

t – the number of numbers in list, then t lines follow [t <= 10^6].
Each line contains one integer: N [0 <= N <= 10^6]

Output

Output given numbers in non decreasing order.

Example

Input:

5
5
3
6
7
1

Output:

1
3
5
6
7

Added by:Roman Sol
Date:2005-03-14
Time limit:2.700s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ERL JS-RHINO NODEJS PERL6 VB.NET
Resource:ZCon

hide comments
2012-05-14 03:36:52 Out0fbounds
used stl and got ac
2012-02-09 13:57:38 Julian Leyh
Time limit very strict for Ada, too. Need about 5s to input, sort, and output 10^6 random integers with N*log(N) algorithm.

IO is very bad in Ada...
2011-11-15 18:14:29 Eric Marthinsen
The time limit on this problem is too low. No one using an interpreted language has been able to get an accepted solution.
2011-10-06 04:28:34 Abhishek Mishra
what we have to use it here is it radix sort...
2011-07-30 15:58:09 Adrian Nazco
i used C# default sort and i got runtime error, i have no idea about what else to do
2011-07-11 09:19:46 Vaibhav Jain
Even on Ideone the code is running fine.What could be the reason for NZEC error ?
2011-07-11 09:12:16 Vaibhav Jain
My Java code is running fine on Eclipse but here it gives NZEC again and again. I have named the class Main and everything else appears correct.Does anybody give me an idea of what might be wrong?
2011-06-28 21:48:01 ndduy1995
You can use distribution Counting in O(n) :D
2011-05-27 12:06:06 ANANT AGARWAL
for those whose STL sort is giving TLE try to use faster I/O methods
2011-03-01 20:06:57 Piotr Dzienis
i used vector tables and sort from stl library and i have acc
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.