#P1247. Special Week With Positive Integers

Special Week With Positive Integers

题目描述

Please notice the shortage of the Memory limit!

Special Week is now just wondering the minimum positive integer which is not in the integer sequence. For example, if the sequence is [2,4,3,4] then the answer is obviously 1, if the sequence is [1,2,3,4] then the answer is obviously 5.

Please notice that there also are some negative integers in the sequence.

So, just given Special Week one integer sequence of nn integers. Please help her to find the minimum positive integer without the sequence.

输入格式

The first line contains one positive integer n(1lenle106)n (1\\le n\\le10^6), indicating the length of the sequence.

The second line contains nn integers a[i](1018lea[i]le1018)a[i] (-10^{18}\\le a[i]\\le10^{18}), the element in the sequence.

输出格式

One integer, the minimum positive integer without the sequence.

样例

4 
2 4 3 4
1
4 
1 2 3 4
5
4 
-1 -2 -3 -4
1