TSORT - Turbo Sort

no tags 

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

hide comments
Priyanshu Srivastava: 2013-08-08 13:57:05

Standard Sorting(C++) - 2.39 s
Merge Sort - 3.11 s
Heap Sort - 3.10 s
Count Sort - 2.33 s

Ouditchya Sinha: 2013-04-29 06:47:25

Merge Sort with Fast I/O : 2.03s
Counting Sort with Even Faster I/O : 0.42s
How is 0.28s possible? Anyone, any ideas?

Stupider: 2013-01-29 16:09:36

the numbers are low
why not counting sort

Last edit: 2013-01-29 16:09:53
Unnati Gupta: 2013-01-23 16:01:21

TLE in Python 2.7

Lai Manh Tuan: 2013-01-10 06:59:21

Time limit is too strict

[EDIT]
Got AC.
Use faster input/output method.

Last edit: 2013-01-10 07:02:09
Onur: 2013-01-09 20:37:38

why i couldnt get AC with lineer sort?

________________________________________

Read&Print with C operations

Last edit: 2013-01-10 14:47:45
(Tjandra Satria Gunawan)(曾毅昆): 2012-12-20 12:08:57

found an algorithm that faster than merge sort ;-)

Deepan: 2012-09-13 04:26:44

got AC using STL :) but merge sort , heap sort failed

anuj kumar: 2012-08-26 05:39:43

Got AC with merge sort... :) :)

radical: 2012-07-28 04:43:37

any solve with python? i try with quick sort and list.sort and the result is Time limit :(


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