## Miracle Sort

View as PDF

Points: 3
Time limit: 5.0s
Memory limit: 6M
Python 10M

Author:
Problem type

How to sort.

#### Input Specification

On the first line, an integer . On the following lines, there will be a sequence of numbers, with each number between and .

#### Output Specification

Using a line break as a separator between numbers, print out the sequence from the input, in sorted order.

• commented on March 17, 2021, 10:47 p.m.

imagine if someone actually passed with bogosort...

• commented on July 15, 2020, 5:28 p.m. edited

For those who spend lots of effort on this problem but still cannot pass, this page might give you an idea about the nature of this problem.

• commented on July 8, 2020, 9:47 a.m. edited

Even if you implement the intended solution, you will get an MLE if you use Python.

edit: you can AC on Python now.

• commented on Feb. 2, 2019, 10:19 p.m. edit 2

what a miracle... this is truly a miracle-based sorting algorithm

• commented on Feb. 2, 2019, 10:36 p.m.

what is the miracle?

• commented on Jan. 31, 2019, 8:00 p.m.

What sorting algorithm am I supposed to use with only 6MB of RAM?

• commented on Oct. 3, 2021, 7:56 p.m. edited

[deleted message 20983094821]

• commented on Jan. 29, 2019, 4:15 p.m.

This comment is hidden due to too much negative feedback. Click here to view it.

• commented on Jan. 29, 2019, 5:22 p.m.

Try this and tell me what you get

4
1 2 3 4
• commented on Jan. 29, 2019, 10:30 p.m.

Aren't the numbers separated by a line break?

• commented on Jan. 30, 2019, 12:14 a.m.

The numbers make 1 sequence out of 4 total sequences.

• commented on Jan. 2, 2019, 6:27 p.m.

This problem is cheese.

• commented on Jan. 1, 2019, 12:51 a.m.

My problem is "java.lang.OutOfMemoryError" and I can't figure out what's causing it; does line breaking have anything to do with this? (I have no clue what a line break is.)

• commented on Jan. 2, 2019, 12:57 p.m. edited

.

• commented on Jan. 2, 2019, 11:15 a.m.

most likely you are storing numbers in an array, with 1000,000 numbers, that requires about 1000,000 * 8 bytes, or about 8 megabytes, which is over the memory limit for this problem

• commented on Aug. 25, 2016, 10:41 p.m.

This comment is hidden due to too much negative feedback. Click here to view it.

• commented on Aug. 27, 2016, 11:17 a.m.

BeepBeep! I'm a bot. Your comment seems sad to us, cheer up! Have a kitten P.S. This bot is powered by A.I. sentiment analysis

• commented on April 16, 2016, 9:49 a.m.

The value range should be from to (long long range), right?

• commented on April 1, 2016, 9:08 a.m.

Use a line break as a separator, not a space. The statement has been updated.