Problems > Minimum of an Array

Minimum of an Array

Difficulty: 800 2000 ms 128 MB

implementation

Given a list of integers, print the smallest one.

Input: the first line has an integer N; the second line has N integers separated by spaces.

Output: one integer — the minimum value.

Constraints:

  • 1 ≤ N ≤ 2000
  • −109 ≤ ai ≤ 109

Sample Tests

Input 1
5
4 2 9 2 8
Output 1
2
Input 2
3
-5 -2 -9
Output 2
-9

Read the Editorial

Discussion (opens after you solve — no spoilers before)

No comments yet.

Submit Your Solution

Log in or create a free account to run and submit code.