LCC '18 Contest 5 J1 - Mints

View as PDF

Submit solution

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

Author:
Problem type

Derek loves mint candy. He has tried a variety of brands and has concluded that the strength of a mint, \(S\), can be measured on a scale from 1 to 1000. Derek is looking for the perfect mint for his imaginary gf in an ideal world, Cecily. From a pile of \(N\) mints, Cecily only wants the second strongest candy. Can you help Derek out?

Input Specification

The first line of input will contain one integer, \(N\) \((2 \le N \le 10^5)\).

The next \(N\) lines will contain a single integer \(S\) \((1 \le S \le 1000)\).

Output Specification

Print the strength of the second strongest mint.

Sample Input 1

4
10
230
56
134

Sample Output 2

134

Sample Input 2

3
20 
20
4

Sample Output 2

20

Comments

There are no comments at the moment.