eolymp
bolt
Try our new interface for solving problems
Problems

Counting sort

Counting sort

Use the magic of counting sort: sort $n$ numbers in the range $[0; 10^5]$. \InputFile First line contains number $n~(1 \le n \le 10^6)$. Then $n$ numbers are given that must be sorted. \OutputFile Print the sorted $n$ numbers.
Time limit 2 seconds
Memory limit 128 MiB
Input example #1
3
2 3 1
Output example #1
1 2 3