CF27A.Next Test

普及-

通过率:0%

时间限制:2.00s

内存限制:256MB

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.

«Polygon» 是一个能够以简单而专业的方式创建编程题目的系统。当你为题目添加测试用例时,相应的表单会要求你输入该测试用例的索引。在大多数情况下,下一个测试用例的索引是显而易见的,因此系统会建议一个默认索引值。该默认值被定义为未被任何先前添加的测试用例所使用的最小正整数。

你需要实现这一功能:编写一个程序,在给定先前已添加测试用例的索引的情况下,确定下一个测试用例的默认索引。

输入格式

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.

第一行包含一个整数 nn(1≤n≤30001 \leq n \leq 3000)—— 之前添加的测试用例数量。
第二行包含 nn 个互不相同的整数 a1,a2,…,ana_1, a_2, \dots, a_n(1≤ai≤30001 \leq a_i \leq 3000)—— 这些测试用例的索引。

输出格式

Output the required default value for the next test index.

输出下一个测试索引所需的默认值。

输入输出样例

  • 输入#1

    3
    1 7 2

    输出#1

    3

输入解题思路,AI测评打分。不知道怎么写?

首页