List Minimum (Easy)

View as PDF

Submit solution

Points: 3 (partial)
Time limit: 0.5s
C# 0.75s
Haskell 1.0s
Java 0.6s
Python 1.0s
Memory limit: 3M
C# 28M
Haskell 6M
Python 12M

Authors:
Problem type
Brute Force Practice 1 — Easy Version

Given a permutation of the integers 1, 2, \dots, N, output the permutation after it has been sorted.

Input Specification

The first line will contain the integer N (1 \le N \le 10^6).

The next line will contain N integers, a permutation of the integers 1, 2, \dots, N.

Output Specification

The sorted permutation on a single line.

Sample Input

3
2 1 3

Sample Output

1 2 3

Comments


  • 1
    Kiki_Delfin  commented on Jan. 12, 2025, 11:23 a.m.

    What Means MLE ?


    • 0
      ev_code  commented on Jan. 12, 2025, 5:00 p.m. edited

      It means memory limit exceeded. There are memory limits on dmoj and if your solution exceeds it, then you get MLE.

      It seems that this problem can't have a list or else it gets MLE. Therefore, since the question states:

      Given a permutation of the integers 1, 2, \dots, N, output the permutation after it has been sorted.

      Therefore, a list isn't necessary at all, and you only need to know the value of N and then you can just print 1 to N.