oj mrJudge
Toggle navigation
  • Login
    • Forget Password
      Login
User Image

Hello, Stranger

Guest
  • Analysis Mode
  • Problems
    • All Problems
    • Latest Problems
  • Join Us Now
  • Registration
  • Contact Us
  • Infomation
  • About
    • Terms of Use
    • Technical Specifications
    • Credits

logsort Batch , stdin/stdout

Registered Users Only

Please login to utilize this feature.

Do note that this website only supports submissions in C++.

logsort.html

This problem is designed to test your implementation of an n log n sort.

Given n numbers, sort them.

PS, bubble/insertion/selection sort are NOT fast enough.

Please do not use qsort, sort, or any other built-in sorting function. Submissions which use these will be deleted. Thanks!

Input

The first line of input contains a single number n (0 ≤ n ≤ 50,000).
This is followed by n numbers which fit in a 32-bit signed integer.

Output

Print the numbers in ascending order, one per line.

Sample Input 1

5
5
9
6
10
5

Sample Output 1

5
5
6
9
10

Tags

Sorting

Subtasks and Limits

Subtask Score #TC Time Memory Scoring
110051s32MBMinimum
2011s32MBMinimum

Judge Compile Command

g++-8 ans.cpp -o logsort -Wall -Wshadow -static -O2 -lm -m64 -s -w -std=gnu++17 -fmax-errors=512

Accepted Submissions

subIDUserTimeMax Time

Past Submissions

subIDUserTimeScore
mrJudge 09.05.20
Copyright © 2020 mrJudge. All rights reserved.