#C1200. Smallest Element After Operations
Smallest Element After Operations
Smallest Element After Operations
You are given an array of n integers. In one operation, you can select any two distinct elements and remove the smaller one. This process is repeated until only one element remains. Your task is to determine the smallest possible element that can remain after performing these operations optimally.
It can be observed that regardless of the order of operations, the minimum element in the original array is always a candidate to remain until the end. Thus, the answer is simply the minimum value in the array.
Input/Output Format:
- The first line of input contains an integer n, the number of elements in the array.
- The second line contains n space-separated integers representing the array.
- Output a single integer, which is the smallest element that can be the final remaining element.
inputFormat
The input is given via standard input. The first line contains a single integer n (1 ≤ n ≤ 10^5). The second line contains n space-separated integers, where each integer fits within a 32-bit signed integer.
outputFormat
Output a single integer that represents the smallest element of the given array.## sample
5
4 3 7 1 5
1