Codeforces Beta Round 27(Codeforces 格式,Div. 2)
A
下一个测试编号
Next Test
Codeforces
1200
原题
←B →

下一个测试编号AI (CI翻译)

«Polygon» is a system which allows to create programming tasks in a simple and professional way. When you add a test to the problem, the corresponding form asks you for the test index. As in most cases it is clear which index the next test will have, the system suggests the default value of the index. It is calculated as the smallest positive integer which is not used as an index for some previously added test.

“Polygon”是一个能够以简单且专业的方式创建编程题目的系统。当你向题目中添加测试时,相应的表单会要求你输入测试编号。由于在大多数情况下,下一个测试的编号是明确的,系统会为编号提供默认值。这个默认值是此前添加的测试中未被用作编号的最小正整数。AI (CI翻译)

You are to implement this feature. Create a program which determines the default index of the next test, given the indexes of the previously added tests.

请实现这一功能。给定此前添加的测试的编号,确定下一个测试的默认编号。AI (CI翻译)

Input

输入格式

AI (CI翻译)

The first line contains one integer $*n*$ ($1 ≤ *n* ≤ 3000$) — the amount of previously added tests. The second line contains $*n*$ distinct integers $*a*_{1}, *a*_{2}, ..., *a*_{*n*}$ ($1 ≤ *a*_{*i*} ≤ 3000$) — indexes of these tests.

第一行包含一个整数 $*n*$($1 ≤ *n* ≤ 3000$),表示此前添加的测试数量。第二行包含 $*n*$ 个互不相同的整数 $*a*_{1}, *a*_{2}, ..., *a*_{*n*}$($1 ≤ *a*_{*i*} ≤ 3000$),表示这些测试的编号。AI (CI翻译)

Output

输出格式

AI (CI翻译)

Output the required default value for the next test index.

输出下一个测试编号所需的默认值。AI (CI翻译)

样例

Input #1
3
1 7 2
Output #1
3
InputCopy OutputCopy
题目信息
题号
27A
时间限制
2 s
内存限制
256 MB
标签
模拟
排序

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(gpt-6.1-sol),如有出入请以原文为准。