## List Minimum (Easy)

View as PDF

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 , output the permutation after it has been sorted.

#### Input Specification

The first line will contain the integer .

The next line will contain integers, a permutation of the integers .

#### Output Specification

The sorted permutation on a single line.

#### Sample Input

3
2 1 3

#### Sample Output

1 2 3

## Comments

• commented on Sept. 18, 2021, 9:46 p.m.

Perhaps searching up what a permutation is might help some people struggling with a TLE error.

• commented on July 24, 2021, 10:32 p.m. edit 2

I'm doing this problem in java and I can pass the first 18 test cases, but the rest all have java.lang.OutOfMemoryError and one has a TLE error. Does anyone have any tips to this problem? Also, I'm not entirely sure what everyone means by "read the question very carefully.", I think I'm overlooking something.

Edit: Figured it out, the info is sneaky lol

• commented on July 11, 2021, 7:26 p.m.

Currently just submitting a blank c++ template uses 3.2MB (for anybody struggling with it in c++). Might be some issue with the problem?

• commented on July 11, 2021, 9:50 p.m.

Do not use #include <bits/stdc++.h>.

• commented on July 12, 2021, 10:06 a.m.

Just including <iostream> still used a little over 3MB, but <cstdio> was 900KB. Couldn't find a solution using cin and cout.

• commented on July 10, 2021, 10:13 p.m.

If you were as unlucky as me, make sure you apply your ideas to your best code currently. I applied the MLE fix in one of my attempts however my code wouldn't have worked regardless if it had an MLE error or not.

• commented on July 10, 2021, 10:44 a.m.

if you're still having memory issues even after figuring it out, remember that not everything is important

• commented on July 9, 2021, 9:58 p.m.

Bro this is a troll :) When you actually read it can be good sometimes.

• commented on July 11, 2021, 10:26 p.m.

No, this is this.

• commented on July 12, 2021, 8:04 p.m.

No, the keyword this is a prvalue expression whose value is the address of the implicit object parameter (object on which the non-static member function is being called).

• commented on July 12, 2021, 8:35 p.m.

No, value is value.

• commented on July 11, 2021, 10:35 p.m.

O_O

• commented on July 9, 2021, 7:42 a.m.

I'm getting AC for the first 7 test cases, but MLE for the rest. Could anyone explain why this is happening? Thanks.

• commented on July 9, 2021, 11:49 a.m. edit 2

Storing 1 million numbers will go past the memory limit in any language. You don't have to store the inputs to solve this problem. If you store the input, you will get MLE!

• commented on May 26, 2021, 11:06 p.m. edit 2

Everyone: read the question very carefully

me: still WAs everything

edit nvm solved it after 900000 hours

• commented on Sept. 15, 2021, 7:52 p.m.

same

• commented on June 27, 2021, 10:58 a.m.

same lol

• commented on Feb. 27, 2021, 2:34 p.m. edit 2

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

• commented on Feb. 21, 2021, 10:44 p.m. edited

Wow. I must say, I really enjoyed this problem. I hate my lack of common sense.

• commented on Dec. 26, 2020, 5:13 p.m.

If you can't find the solution in the problem statement via rereading, looking at your output will help.

• commented on Dec. 29, 2020, 3:52 p.m.

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

• commented on Oct. 24, 2020, 4:03 p.m.

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

• commented on Aug. 30, 2020, 4:43 p.m.

this question's a straight up troll lmao

• commented on Aug. 6, 2020, 5:27 p.m.

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

• 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.

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

This question took me longer then it should have.

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

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

• commented on Sept. 20, 2020, 4:44 a.m.

how come it doesn't work?????????????? no inputs

• 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

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

Easier than it looks

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

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

• 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 :)

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

How did you get over the memory error?

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

As stated below, read the question very carefully.

• 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.

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

make some of your own test cases, read the question , 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

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

Got it. But there still is a memory issue

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

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

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

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

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

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

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

I keep on getting Memory Error.

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

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

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

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

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

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