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
Devashish: 2014-06-28 15:48:37

Abhinav Gupta ..you don't remove the duplicate numbers

Abhinav Gupta: 2014-06-27 19:18:03

How to remove duplicate numbers?

Ankit Aggarwal : 2014-06-26 19:57:41

use qsort() function in c

Ac-3.34s

Jugal kishor sahu: 2014-03-12 14:43:04

why i am geting wrong answer.i am using tree inorder traversal.

harrypotter192: 2014-03-02 06:15:49

nice one :)
no sorting algorithm required :P

TCony: 2014-02-09 09:43:48

Time limit is a little too strict. my own qsort got TLE, but STL's sort ACed. STL's implementation in MinGW is IntroSort. TimSort is the implementatin of Python 2.3+.

leafmoon: 2014-01-17 06:50:47

I used
cin.tie(0);
ios::sync_with_stdio(false);
and cout<<"\n"
I got AC (2.3s)

Last edit: 2014-01-17 06:51:12
DanieV: 2014-01-12 11:42:07

C++ users dont use cin,cout!!You will get TLE.Quicksort,Heapsort,Mergesort will work fine

DanieV: 2014-01-12 11:35:59

WTF QUICK SORT GETS TL!

Ankit Jain: 2014-01-03 12:30:02

lol....happy stl sort everyone !!!


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