CF27A Next Test

    • 265通过
    • 638提交
  • 题目来源 CodeForces 27A
  • 评测方式 RemoteJudge
  • 标签 枚举,暴力 桶排 概率论,统计
  • 难度 入门难度
  • 时空限制 2000ms / 256MB

题解

  • 提示:收藏到任务计划后,可在首页查看。
  • 最新讨论 显示

    推荐的相关题目 显示

    题意翻译

    给出n个互不相同的整数a[i],从小到大找第一个没有出现过的整数。

    输入:第一行一个正整数n,之后是n个整数a[i];

    输出:一个整数x,即第一个没有出现过的整数。

    1<=n<=3000 1<=a[i]<=3000

    translated by 稀神探女

    题目描述

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

    输出格式:

    Output the required default value for the next test index.

    输入输出样例

    输入样例#1: 复制
    3
    1 7 2
    
    输出样例#1: 复制
    3
    
    提示
    标程仅供做题后或实在无思路时参考。
    请自觉、自律地使用该功能并请对自己的学习负责。
    如果发现恶意抄袭标程,将按照I类违反进行处理。