CF27A.Next Test

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

«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.

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.

输入格式

The first line contains one integer nn ( 1<=n<=30001<=n<=3000 ) — the amount of previously added tests. The second line contains nn distinct integers a1,a2,...,ana_{1},a_{2},...,a_{n} ( 1<=ai<=30001<=a_{i}<=3000 ) — indexes of these tests.

输出格式

Output the required default value for the next test index.

输入输出样例

  • 输入#1

    3
    1 7 2
    

    输出#1

    3
    
首页