1144 The Missing Number (20 分)

Ubuntu 22.04下GNU Radio 3.10全家桶编译避坑实录:从UHD、VOLK到WiFi收发模块gr-ieee802-11 本文详细介绍了在Ubuntu 22.04系统下编译安装GNU Radio 3.10全家桶的完整流程,包括UHD驱动、VOLK优化库以及WiFi信号处理模块gr-ieee802-11的集成。通过逐步指导解决版本兼容性和依赖问题,帮助研究人员快速搭建高效的软件定义无线电开发环境,特别适合使用USRP设备进行无线通信研究的开发者。 阅读详情

版本2

可以适当的做一点优化,考查的散列。但是这道题还可以优化,详情见左程云的面试指南。

#include <iostream>
#include <cstdio>
#include <vector>
#include <cmath>
#include <cstring>
#include <unordered_map>
#include <algorithm>
using namespace std;
const int N = 1e5+5;
int arr[N] = {0};
int main(){
	int n, x;
	scanf("%d", &n);
	int r = n;
	for(int i = 0; i < n; i++){
		scanf("%d", &x);
		if(x > 0 && x <= r) arr[x] = 1;
		else r--;
	}
	for(int i = 1; i <= r+1; i++){  
		if(arr[i] == 0)	{
			printf("%d\n", i);
			break;
		}
	}
	
	return 0;
}

版本1

map的应用,注意使用数组hash会在最后一个测试点上超时,而且数组开不了int范围大小的空间。

#include<cstdio>
#include<cstring>
#include<unordered_map>
using namespace std;
int main(){
	int n,x;
	unordered_map<int,bool> mp;
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		scanf("%d",&x);
		mp[x] = true;
	}
	for(int i=1;;i++){
		if(mp[i] == false){
			printf("%d",i);
			break;
		}
	}
	return 0;
}
AD20 Channel-Offset Error 解决办法 提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档 文章目录前言AD20 PCB相同电路模块ROOM格式复用时出现 Channel-Offset Error 解决办法一、问题现象二、解决办法 前言 AD20 PCB相同电路模块ROOM格式复用时出现 Channel-Offset Error 解决办法 一、问题现象 我们经常在使用Room格式快速布局相同模块电路时出现以下问题, 二、解决办法 相同模块电路PCB布局复制的过程网上有很多,这里不再做赘述,步骤都差不多,只说问题根源; 1:. 阅读详情

相关推荐

基于STM32F103的二维码识别项目——OV7670篇

此系列用于记录做过的项目,这篇文章介绍基于STM32F103的二维码识别项目之OV7670FIFO模块。

beyourself_he的博客 4298

「1144」The Missing Number

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

weixin_52435933的博客 203

【电动汽车再生制动控制技术(万字长文,图文并茂)】

电动汽车再生制动的基本原理是:通过具有可逆作用的电动机/发电机来实现电动汽车动能和电能的转化。在汽车减速或制动时,可逆电机以发电机形式工作,汽车行驶的动能带动发电机将汽车动能转化为电能并储存在储能器(蓄电池或超级电容器)中;在汽车起动或加速时,可逆电机以电动机形式工作,将储存在储能器中的电能转化为机械能给汽车。这对于改善汽车的能量利用效率,延长电动汽车的行驶距离是至关重要的。

CSDN-新能源汽车研发测试专业博主 1589

1144 The Missing Number

最后一个点运行时错误,段错误,可能溢出,但是找不到原因。 #include <iostream> using namespace std; int main (){ int N, a[100005] = {0}, n; cin >> N; for(int i = 0; i < N; i++){ cin >> n; if(n &lt...

北冥有鱼 216

基于STM32+华为云设计的智慧农业灌溉系统(2023升级版)(158)

本项目设计一种基于STM32的智慧农业监测系统。该系统能够检测空气温度、湿度、光强度和土壤湿度等关键指标,并自动调节浇水量,实现作物生长环境的精细化管理。同时,本项目还支持本地LCD屏幕数据显示和通过ESP8266上传数据到华为云物联网平台,同时搭建流媒体服务器实现摄像头远程监控。最重要的是,本项目将利用Qt开发Android手机APP,使用户可以远程查看监测情况,了解农作物生成情况。

1万+

QT自制TCP服务器

TCP服务器 网络调试助手

大脑曝光 3628

PAT 1144 The Missing Number(20 分)

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

Hickey_Chen的博客 360

Horn-Schunck光流算法的Python实现

光流是计算机视觉领域中的一个重要概念,它描述了图像中物体在时间上的运动。Horn-Schunck光流算法是一种经典的光流估计方法,通过对图像的亮度变化进行建模,来估计像素的运动速度。在本文中,我们将使用Python实现Horn-Schunck光流算法,并提供相应的源代码。请注意,该算法假设图像上的亮度变化主要由物体的运动引起,并且假设光流在整个图像上是稠密的。在上面的示例中,我们首先读取了两个输入图像,然后使用我们实现的Horn-Schunck光流算法估计了它们之间的光流。首先,我们需要导入一些必要的库。

持续更新 499

pat1144 The Missing Number

题意:输出给定序列中没有出现的最小正整数。 思路:把正数排序去重后遍历一下就好。 代码 #include &lt;iostream&gt; #include &lt;cstdio&gt; #include &lt;cstring&gt; #include &lt;algorithm&gt; #include &lt;cmath&gt; using namespace std; cons...

cccsssxxx 180

Orin 10G PHY网络分析

由于调试用的10G PHY,所以整理下分析过程; 1.从Orin devkit 丝印来看RJ45 对应J17 通过搜索 MGBE_PHY_A_N 找到连接的10G PHY, 原理图上标明了MDIO address 为0x0, 使用的PHY 芯片为 Marvel 的AQR113C, 主要特性: 架构: 关键特征: MDC 连接了GPIO26_XFI0_MDC; MDIO 连接了GPIO25_XFI0_MDIO; 通过pinmux_config映射表也可以..

乐于分享 5679

【肌电处理】肌电信号EMG积分肌电值+均方根值+中值频率+平均功率频率【含Matlab源码 3386期】

肌电信号EMG积分肌电值+均方根值+中值频率+平均功率频率 完整的代码,方可运行;可提供运行操作视频!适合小白!

订阅付费专栏Matlab(奶茶价版),可赠送奶茶价版付费专栏指定代码1份; 832

1144 The Missing Number (20分)

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

DayDream_x的博客 247

IEC104协议学习专栏内容规划

IEC104协议的编程学习

sixtome 1113

1144 The Missing Number (20分)

1144The Missing Number(20分) 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. Fo...

chen_zan_yu_的博客 251

假人有限元模型

假人模型,车辆碰撞假人有限元模型,适合做乘员安全的研究者利用

LinePhone3.2.7(android端最新版本) sip客户端

SIP客户端For android:LinePhone3.2.7(最新版本),官网地址:http://www.linphone.org/

1144 The Missing Number (20 分)

1144 The Missing Number (20 分) 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. F...

zhangshuosummer的博客 341

廖雪峰Python教程[完整版]

廖雪峰的python教程整理的,已经排好版了,而且还是完整的,适合小白

1144 The Missing Number (20 分)

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

92377 353

大中型超市收银系统(可直接运行)

光步前台收银系统系统功能:商品销售、商品退货、挂单、收银员权限、会员销售、单品取消、整单取消、商品查询、脱机销售、脱机数据上传,基本资料下载,开钱箱、小票打印、收款结算,支持多币种付款方式(现金、储值卡、礼券、微信等),支持多种促销。运行环境:.net 4.0登陆信息用户名:1001 密码:123456内置商品信息,商品编码可输入00001000 - 00010000,测试效果相关功能键F5 结算 F9挂单 F11商品查询 F8退货 Insert单品取消 Del整单取消 F12开钱箱F2 会员 Ctrl+Z退出系统 Home 锁屏 相关源码待公开

【1144】The Missing Number (20 分)

#include<iostream> #include<stdio.h> #include<stdlib.h> #include<math.h> #include<string.h> #include<algorithm> #include<map> #include<vector> #inclu...

发现问题,并解决问题,批判性思维 566

PAT 1144 The Missing Number (20 分)

1144 The Missing Number (20 分) 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. F...

YOUN尔 145

1144 The Missing Number(20 分)

1144 The Missing Number(20 分)提问 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. ...

Become hunger become strong 819
上一篇: 1084 Broken Keyboard (20 分)
下一篇: 1146 Topological Order (25 分)
SYaoJun
博客等级 码龄11年 287粉丝 1327原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值