Passionate Sorting
InterviewTime limit1sMemory limit512 MB
Read N numbers and print them in ascending order separated by spaces.
- Level
Easy1 of 10
- Topics
- Sorting, Implementation
- Solved
- No attempts yet
Problem
Hyeongjun has a sequence. He wants to sort this sequence passionately. Can he sort it?
Input
The first line gives the length of the sequence, (1 ≤ ≤ 500,000).
The second line gives each element of the sequence in order, separated by spaces. The absolute value of is at most 2 million.
Output
Sort the sequence in ascending order and print the elements one by one, separated by spaces.
Hint
Try googling the sorting function for your language~~
For example, in C++ you can sort the array arr with sort(arr, arr+n);, and in Python with arr.sort().