## List Minimum

View as PDF

Points: 4
Time limit: 2.0s
Memory limit: 256M

Problem types
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

You have a list of unique numbers each no larger than . The size of the list is no greater than . You perform the following operation on the list repeatedly: take the minimum of the numbers, and remove it from the list. You stop when the list is empty.

In what order are the numbers removed?

#### Input

The first line will have the size of the list.

Each line after that will be an element of the list. You are guaranteed no two elements are the same.

#### Output

Print one line for each time the operation was performed: the number that was removed at that step.

#### Sample Input

3
5
8
2

#### Sample Output

2
5
8

• commented on Dec. 30, 2018, 10:09 p.m.

take the minimum of the numbers, and remove it from the list. should it be the smallest?

• commented on Dec. 31, 2018, 7:03 p.m.

yeah just each time find the current minimum number in the array and: print it(the smallest) & remove it

• commented on Sept. 26, 2018, 8:31 p.m. edited

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

• commented on Oct. 5, 2018, 5:37 p.m. edit 2

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

• commented on Nov. 2, 2018, 4:10 p.m. edit 2

ItzMatthew, YOU ARE UNDER ARREST FOR COPY AND PASTING CODE! We have found multiple submissions have been copied. Please refrain from doing this again.

Proof:

Problem:https://dmoj.ca/problem/boolean

Offender’s code:https://dmoj.ca/submission/1076312

Problem:https://dmoj.ca/problem/bf3

Offender’s code:https://dmoj.ca/submission/1076326

Note: Any future submissions will be monitored and reviewed.

• commented on Nov. 5, 2018, 4:58 p.m. edit 2

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

• commented on Oct. 30, 2019, 9:21 a.m.

likely story buddy

• commented on Nov. 7, 2018, 10:01 a.m.

Firstly, I would like to inform all users that CopyPastePolice, NoCopyPaste, CopyPastingFromGithubIsWrong, etc, are not affiliated with the DMOJ admins. These are simply users who chose to investigate copy-pasted submissions on their own time.

• commented on Nov. 8, 2018, 9:38 p.m.

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

• commented on Nov. 9, 2018, 11:56 a.m. edit 2

Good thing you're reformed man! Please refrain from copying & pasting code in the future. Thanks!

sincerely, roronoa_zoro1540 (aka CopyPastePolice's sidekick)

• commented on Sept. 26, 2018, 10:37 p.m. edit 2

YOU'RE UNDER ARREST

It has come to our attention that you've been copying and pasting solutions on DMOJ. This does not show good sportsmanship and is unfair to DMOJistan. Blindly copying and pasting code does not improve your own abilities and breaks DMOJ's rules.

Proof:

Example 1: IOI 2015 P6 Towns - https://dmoj.ca/problem/ioi15p6

Offender's Code: https://dmoj.ca/src/1009192

Source: https://dmoj.ca/src/992031

Example 2: CCO 2018 P5 Boring Lectures - https://dmoj.ca/problem/cco18p5online

Offender's Code: https://dmoj.ca/src/1019799

Source: https://dmoj.ca/src/1018785

Edit: The offender's submissions have been deleted and his points have been reverted.

• commented on Sept. 27, 2016, 3:40 p.m. edited

A note to new users: please do not post notes, hints, or solutions in problem comments.

What may seem obvious to you may not be obvious to others. There are many ways to solve problems like these, and they exist to encourage new contest programmers into thinking about the efficiency of their solutions. Posting a solution — no matter how trivial — defeats this purpose.

• commented on Nov. 7, 2016, 12:11 p.m.

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

• commented on Nov. 8, 2016, 12:25 a.m.

That's fine, and a good intuition for harder problems. However, 3-5 point problems should usually be taken at face value, as there are rarely any tricks involved.

• commented on Sept. 27, 2016, 4:13 p.m.

Just to clarify, clarifications are allowed, right?

• commented on Sept. 27, 2016, 4:50 p.m.

Of course, and even hints may be appropriate for harder problems, where a nudge towards the right approach isn't the same as giving the entire problem away.

• commented on Sept. 24, 2016, 8:46 p.m.

Shhh