List Minimum

View as PDF

Submit solution

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

Problem types
Brute Force Practice 1

You have a list of unique numbers each no larger than 1000. The size of the list is no greater than 50. 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 Specification

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 Specification

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

Comments

There are no comments at the moment.