3505: Mex Query--2018HBCPC A

内存限制:128 MB 时间限制:1.000 S
评测方式:文本比较 命题人:
提交:5 解决:3

题目描述

Give n non-negative integers, please find the least non-negative integer that doesn’t occur in the n numbers.

输入

The first line is an integer n.

The second line are n non-negative integers ai.

1<=n<=10^3,1<=a1<=10^3.

输出

Output a line with the answer.

样例输入 复制

4
4 0 1 1

样例输出 复制

2