题目链接:1144 The Missing Number (20 point(s))

Description

Given N integers, you are supposed to find the smallest positive integer that is NOT in the given list.

Input Specification

Each input file contains one test case. For each case, the first line gives a positive integer N (≤10​5​​). Then N integers are given in the next line, separated by spaces. All the numbers are in the range of int.

Output Specification

Print in a line the smallest positive integer that is missing from the input list.

Sample Input

  1. 10
  2. 5 -25 9 6 1 3 4 2 5 17

Sample Output

  1. 7

分析

PAT(A) 1144 The Missing Number(C)统计的更多相关文章

  1. PAT 甲级 1144 The Missing Number (20 分)(简单,最后一个测试点没过由于开的数组没必要大于N)

    1144 The Missing Number (20 分)   Given N integers, you are supposed to find the smallest positive in ...

  2. PAT 甲级 1144 The Missing Number

    https://pintia.cn/problem-sets/994805342720868352/problems/994805343463260160 Given N integers, you ...

  3. PAT 1144 The Missing Number

    1144 The Missing Number (20 分)   Given N integers, you are supposed to find the smallest positive in ...

  4. PAT 1144 The Missing Number[简单]

    1144 The Missing Number(20 分) Given N integers, you are supposed to find the smallest positive integ ...

  5. [PAT] 1144 The Missing Number(20 分)

    1144 The Missing Number(20 分) Given N integers, you are supposed to find the smallest positive integ ...

  6. 1144 The Missing Number (20 分)

    Given N integers, you are supposed to find the smallest positive integer that is NOT in the given li ...

  7. 1144. The Missing Number (20)

    Given N integers, you are supposed to find the smallest positive integer that is NOT in the given li ...

  8. 1144 The Missing Number

    Given N integers, you are supposed to find the smallest positive integer that is NOT in the given li ...

  9. PAT_A1144#The Missing Number

    Source: PAT A1144 The Missing Number (20 分) Description: Given N integers, you are supposed to find ...

随机推荐

  1. JPA 原生SQ查询

    参考文章 https://blog.csdn.net/coding_1994/article/details/84575943 https://blog.csdn.net/m0_37776094/ar ...

  2. win10 eclipse连接虚拟机ubuntu中的hdfs

    1.eclipse安装连接hadoop的插件hadoop-eclipse-plugin-2.6.0(注意自己hadoop的版本) 将该插件放在eclipse安装路径的plugins文件夹中. ps:我 ...

  3. 覆盖elementui样式

    前台以表格形式展示后台数据,图片或视频点击后弹出框播放,用el-dialog实现. 希望播放视频的时候不显示dialog的背景那些. 尝试 scoped 无果 <style lang=" ...

  4. [Eclipse]已经写好的代码怎样切换为unix下的换行符?

    问题:使用eclise提交文件到github,每行文件后面都有^M字符 切换换行符的显示格式, 但是这样只能对新文件起作用,修改旧文件:

  5. 字典树(查找树) leetcode 208. Implement Trie (Prefix Tree) 、211. Add and Search Word - Data structure design

    字典树(查找树) 26个分支作用:检测字符串是否在这个字典里面插入.查找 字典树与哈希表的对比:时间复杂度:以字符来看:O(N).O(N) 以字符串来看:O(1).O(1)空间复杂度:字典树远远小于哈 ...

  6. ztree checkbox父子联动

    1. 对于ztree而言,如果需要设置或者取消ztree的父子联动,只要在setting里面设置chkboxType的参数即可: 其中Y表示被checkbox被勾选时的联动情况,N表示取消勾选时的联动 ...

  7. Python判断是否是闰年

    year = 2012 if year % 100 != 0 and year % 4 == 0: print('闰年') elif year % 100 == 0 and year % 400 == ...

  8. osg gis编译日志

    1>------ 已启动全部重新生成: 项目: ZERO_CHECK, 配置: Debug x64 ------1> Checking Build System1> CMake do ...

  9. Spring cloud微服务安全实战-6-7jwt改造总结

    限流的改造. 同样注意,不要声明成Spring的Bean 在上面声明Rateliiter 如果能获取到权限继续往下走,没权限就返回,to many request的错误信息. 加到过滤器链上 加载Sp ...

  10. C++接口的概念

    满足下面条件: 1.类中没有定义任何的成员变量 2.所有的成员函数都是公有的 3.所有的成员函数都是纯虚函数 4.接口是一种特殊的抽象类