LCC '18 Contest 5 J1 - Mints

View as PDF

Submit solution

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

Author:
Problem type
Allowed languages
Assembly, Awk, Brain****, C, C++, Clang, Clang++, COBOL, D, Fortran, Go, Java, JS, Lisp, LOLCODE, Lua, NASM, NASM64, Pascal, Perl, PHP, Processing, Python, Racket, Ruby, Rust, Sed, TCL, Text, Turing

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 gf in an ideal world, Emily. From a pile of N mints, Emily 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 1

134

Sample Input 2

3
20
20
4

Sample Output 2

20

Comments

There are no comments at the moment.