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
Allowed languages
Ada, Assembly, Awk, Brain****, C, C#, C++, COBOL, CommonLisp, D, Dart, F#, Forth, Fortran, Go, Groovy, Haskell, Intercal, Java, JS, Kotlin, Lisp, Lua, Nim, ObjC, OCaml, Octave, Pascal, Perl, PHP, Pike, Prolog, Python, Racket, Ruby, Rust, Scala, Scheme, Sed, Swift, TCL, Text, Turing, VB, Zig
Brute Force Practice 1 — Easy Version

Given a permutation of the integers 1, 2, \ldots, 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, \ldots, N.

Output Specification

The sorted permutation on a single line.

Sample Input

3
2 1 3

Sample Output

1 2 3

Comments


  • 2
    hjanday  commented on May 10, 2020, 1:22 p.m.

    I just solved it, and everyone is correct, you need to nit pick certain bits of information and think of a solution. Phew, that took me awhile, I enjoyed this problem! Thumbs up to the creator.


  • 1
    DorshReal  commented on April 21, 2020, 2:06 p.m.

    This question took me longer then it should have.


  • 4
    Redstone_ray  commented on April 5, 2020, 6:58 p.m.

    Tip: you don't need to store inputs you don't need to save memory


  • 4
    alihu264  commented on March 13, 2020, 4:20 p.m.

    Lol this was actually way easier than I thought

    Learning to read really does come in handy sometimes


  • 0
    Frontear  commented on Nov. 19, 2019, 4:53 p.m. edited

    To anyone still having problems with this question, read the part about permutations carefully. Consider the implications of having one, and the answer will come really easily.


  • 7
    Cools  commented on July 7, 2019, 4:28 p.m.

    Easier than it looks


  • 3
    Zanger  commented on March 30, 2019, 11:34 p.m.

    Omg the way this question phrases the goal is just down right dirty. gawd XD


  • 1
    benito255  commented on March 6, 2019, 6:24 a.m.

    OMG, finally got there with python - and learned something new which I guess is the point :)


    • 0
      Julien  commented on Nov. 30, 2019, 6:50 p.m.

      How did you get over the memory error?


      • 2
        AlanL  commented on Nov. 30, 2019, 8:52 p.m.

        As stated below, read the question very carefully.


  • -1
    lele  commented on Jan. 23, 2019, 8:59 p.m.

    Why is my solution outputting wrong answers? It was fine until I made a change to save memory.


    • -1
      magicalsoup  commented on Jan. 23, 2019, 9:05 p.m.

      make some of your own test cases, read the question carefully, be sure not to miss out on any important properties of this question, and the reason you are gettingWA is simply because your program is incorrect


      • 0
        lele  commented on Jan. 26, 2019, 6:36 p.m.

        Got it. But there still is a memory issue


  • 0
    sankeeth_ganeswaran  commented on Dec. 29, 2018, 10:47 a.m. edited

    Can someone tell me what's wrong with my java code? Thanks.


    • 13
      Rimuru  commented on Dec. 29, 2018, 11:21 a.m. edited

      Regarding the question, it states that you are given a permutation of the integers 1 to N. This is the best hint I can give you: don't try to sort the integers or store it in an array. The memory limit for java is 3 MB.

      The point of this question is to read it very, very carefully. Good luck!


  • 4
    richardyou777  commented on Dec. 23, 2018, 4:13 p.m.

    I thought List Minimum (Easy) would be easy, but no.


    • -5
      lele  commented on Jan. 23, 2019, 9:17 p.m.

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


  • 0
    Arihan10  commented on Dec. 18, 2018, 1:09 p.m.

    I keep on getting Memory Error.


    • 0
      magicalsoup  commented on Dec. 18, 2018, 6:30 p.m.

      That means you are using too much memory, read the question carefully


  • 0
    y2536209406  commented on Nov. 4, 2018, 12:06 a.m.

    The biggest problem in this question is to fully understand the question


  • 18
    Plasmatic  commented on Oct. 25, 2018, 10:57 p.m.

    Tip for anyone that's having issues with this question: reread the problem statement.