CCF 201612-1 中间数 C++ need attention

51雾化器实现 1. 雾化器简介 雾化器是将试液雾化的一种器械。雾化器是原子化系统的重要部件,其性能对测定的精密度和化学干扰等产生显著影响。因此要求雾化器喷雾稳定、雾滴细小、均匀和雾化效率高。雾化器的类型有超声雾化器,空气压缩式雾化器,网式雾化器。超声雾化器因其价格合适,适合家用,被广泛应用于加湿器,香薰机等各种小家电,也在医疗领域有很多的应用。家用雾化器的主要器件是一枚雾化片。 家用雾化器分为两种不同类别雾化片,实孔雾化片和微孔雾化片,这两种的喷雾方法和工作原理是有所不同的。不同的雾化片需要特定的频率才能工作。 实孔雾 阅读详情

在这里插入图片描述
在这里插入图片描述
思路:排序之后,要想是中间数,如果是奇数个,那就只可能是中间的那一个数,如果共偶数个,那么中间的两个数必然相等,所以只需要判断a[n/2]处的数是不是中间数就可以了。

#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
	int n;
	cin >> n;
	int a[n];
	int count1=0,count2=0;
	for(int i=0;i<n;i++)
	{
		cin >> a[i];
	}
	sort(a,a+n);
	for(int i=0;i<n;i++)
	{
		if(a[i]<a[n/2]) count1++;
		else if(a[i]>a[n/2])  count2++;
	}
	if(count1==count2) cout << a[n/2] << endl;
	else   cout << "-1" << endl;
	return 0;
}
西安交通大学软件学院——分布式系统练习题(综合题) 摘要:本文探讨了分布式系统的核心特性与关键问题。首先阐述了分布式系统的8种透明性特性,包括访问、定位、迁移等。然后通过具体案例分析了分布式事务的回滚机制、域名解析的迭代与递归过程、不同分布式系统的异同比较。重点讨论了RPC通信中客户端/服务器崩溃的处理方法,包括消灭、再生和到期三种策略。最后介绍了Lamport时间戳算法在进程通信中的应用及问题解决方案。全文涵盖了分布式系统设计中的透明性、可靠性、一致性等核心问题。 阅读详情

相关推荐

Mac无管理员权限安装NVM全攻略(附国内镜像加速)

本文详细介绍了在Mac电脑无管理员权限的情况下,如何通过Git克隆方式安装Node版本管理工具NVM,并配置国内镜像源以加速下载。攻略涵盖环境检查、安装步骤、Shell环境变量配置、镜像加速设置以及常用命令和常见问题解决方案,帮助开发者绕过权限限制,高效管理Node.js版本。

weixin_29296241的博客 489

2024年最新Dell服务器RAID常用管理命令总结_enclosure affinity,2024年最新2024软件测试大厂面试经验

oror缓存策略解释:CachedDirect例子:oror4.1 创建一个 raid5 阵列,由物理盘 2,3,4 构成,该阵列的热备盘是物理盘 54.2 创建阵列,不指定热备4.3 删除阵列4.4 在线添加磁盘意思是,重建逻辑磁盘组1,raid级别是5,添加物理磁盘号:1:4。重建完后,新添加的物理磁盘会自动处于重建(同步)状态,这个 时候 fdisk -l是看不到阵列的空间变大的,只有在系统重启后才能看见。7、删除全局热备。

2401_84563561的博客 1911

Istio ICA考试之路---2-2

找到dr部分,这部分可以在mirroring里找也可以和题2-1一样在Traffic Management的dr里复制,内容都一样。此题之后都是在cluster-2上操作,所以就不需要再切换了.之后的几题2.1节就忽略掉了。可以看到,80%的流量被镜像到了dev上,实际考试这步可以忽略。看到ex-ip是192.168.126.220。获取gw,把gateways加入到vs配置中。获取istio-ingress的ex-ip。就获得了这样一个模板文件。查看2个pod的日志。

Q先生 854

服务器死机/无故宕机排查思路/服务器起不来

2、查看/var/log/message 日志;需要收集 /var/log/message* 及 /var/log/sa/ 下所有日志,打包保存。还可以看 /usr/kib/cloudmanager/components/lark/log/opt.log。/var/log/messages:几乎所有的开机系统发生的错误都会在此记录。2、风扇异响:查看BMC,坏了一个风扇其他的所有的风扇会全速转。我的/var/log/下的messages日志文件有。messages文件在/var/log/下。

Zs0509的博客 3200

家用扫地机器人研发技术路线-第四部分:如何一步步做出来 | 4阶段 · 从原型到量产

摘要:本文详细介绍了扫地机器人从原型到量产的研发流程,分为4个关键阶段。首先聚焦四大技术难点:SLAM定位、AI视觉识别、仿生机械臂和静音风机系统。研发过程包括实验室原型验证、工程样机测试、小批量真实场景测试和量产导入四个阶段,每个阶段设有严格评审标准。特别强调测试贯穿全程,包括模块单元测试、整机集成测试、长期可靠性测试和多样化场景模拟,确保产品在上市前完成数百次真实环境验证。整个流程体现了从技术攻关到产品落地的系统性工程思维。

智能硬件研发,欢迎交流 191

lammps教程:ovito免费输出高清图片方法

基本原理是调用ovito软件包中的TachyonRenderer模块,该模块可实现Tachyon渲染,达到和ovito 2.9 Tachyon完全相同的效果。这种方法在后来的ovito版本中已经不能使用,但是ovito 2.9版本在后处理方面功能较少,使用起来也不是特别方便。在之前的推文中,曾介绍过使用ovito 2.9版本更换Tachyon渲染器实现高清图片的输出。这个方法只需要配置ovito模块即可,完全免费,不需要购买ovito pro版。具体的配置参数可到ovito官网查询。大家好,我是小马老师。

lammps_jiayou的博客 2766

MegaCli工具使用

由于最近工作接触的服务器,BIOS未集成Optional rom,所以无法在BIOS下图形化设置Raid, 只能在OS下用工具MegaCli,所以熟悉了Megacli的命令

妳为谁隐身 3435

Python之afdx包语法、参数和实际应用案例

Python 的 afdx 包是针对 AFDX 协议的轻量级开发工具,专注于 AFDX 数据帧的解析、构造、发送/接收、协议合规性校验等核心能力,广泛应用于航空电子设备测试、仿真、数据监控等场景。

王国平的博客 982

一次HP 阵列卡排障

公司使用的是HP gen8机器,用的是p420i阵列卡,同时在系统的另一端,nagios监控系统配合nrpe脚本check_hpasm定期检测硬件健康。最近为了让机器更带劲,加上了SSD硬盘,机械硬盘仅用作大容量存储,在感受速度与激情的同时,悲剧接踵而至。nagios 监控报警,硬件出错:CRITICAL - da controller 1 in slot 1 needs attention, S...

weixin_34381687的博客 879

用 CDS 作为 Referenced Data Source 开发 SAP Gateway OData 服务,一条更轻的 SEGW 路线

本文介绍了SAP Gateway项目中从传统手工建模到基于CDS View的现代化开发方式转变。主要内容包括: 传统方式需要在SEGW中手动创建Entity Type、Entity Set等元素,并在DPC_EXT中编写大量查询逻辑,存在模型层和业务逻辑重复表达的问题。 7.50版本后,SAP Gateway与ABAP CDS深度集成,可通过SEGW直接引用CDS View作为数据源,自动生成数据模型和SADL读取逻辑,支持完整的OData查询功能。 最佳实践建议通过Consumption View而非直接

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 704

建行报专版报道建设银行金融科技发展历程

经过十多年的建设,总行前中后台部门都有了自己的业务系统,但系统“部门”特征显著,渠道、客户、产品的横向整合不足,产品系统层次化、结构化、参数化程度不高,渠道支持产品快速部署以及跨渠道服务能力不足,管理分析类系统建设相对滞后,系统较弱的可扩展能力在应对高速增长的交易量时已疲态尽显,同时安全稳定运行的压力和风险日益积聚。站在新的历史起点上,科技条线将聚焦主责主业,完善信息科技管理体系,紧紧围绕安全生产中心任务,持续推动技术能力复用共享和自主可控,为全行做好金融五篇大文章,推动业务高质量发展提供技术支撑。

银行信息系统应用架构详解 384

Attention大详解(Attention is all you need)

1. 写在前面 今天分享的论文是2017年谷歌团队发表的一篇论文,这是一篇非常经典的自然语言处理领域的文章,基于这篇文章,才有了最近非常火的bert, Albert等模型,接触这篇文章是在一次直播中看到的,因为经典,所以就想着读了读(虽然不是搞nlp的,但总感觉知识这东西都有一定的通性,多学一些肯定没有坏处,万一以后要用到呢?)。但是这篇论文本身我读了一遍之后,感觉不太懂,感觉里面有些东西并不是说...

Miracle8070 1万+

【ROS2】从yaml文件中读取参数配置

ROS2:从yaml中读取参数,到节点;使用C++演示参数的增、删、改、查、遍历、监听变化

郭老二 1284

CCF 201612-2 工资计算 C++ need attention

#include <iostream> using namespace std; int cal(int s) { int b; int a=s-3500; if(a<=1500) { b=s-0.03*a; } else if(1500<a&&a<=4500) { b=s-0.03*1500-(a-1500)*0.1; } else if(4500<a&&a<=9000) { b=s-0.03*15.

cloudless_sky的博客 180

老版QQ原生表情gif动态

这是老版的QQ表情,不过全是动态的的,Windows照片查看器是不会动的,可以右击用浏览器打开查看,再说一遍是老版的,只是分享给宁愿用老版也要动态的人。

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

【Transformer模型】:Attention is all your need(附attention的代码)

tranformer已经火了好长一段时间了,一直只是只闻其名不知其意,特地看了attention is all your need。 这篇论文摒弃了传统encoder-decoder模型必须结合cnn或者rnn的固有模式,只用了attention模型,可谓大道至简。现在主流的序列转化模型都是基于端到端的encoder-decoder的RNN或者CNN网络结构模式。现在都是在该框架中引入了a...

快来学习鸭~~~ 5024

VC中sqlite的使用

在VC中对sqlite的使用,实现数据库大批数据的快速插入,读取数据库中的数据在ListCtrl中显示

RAID卡 设置详解(LSI)

这边列出一些设定raid卡常见的设定参数 Stripe Size ( 磁条大小 ): 磁条为横跨多个实体磁碟的资料区段。支援磁条大小为 8、16、32、64及 128 Kbytes 的资料区段。预设值为 64 KB。 Read Policy ( 读取政策 ): Always read ahead ( 始终预先读取 ):预先读取功能可让控制器在预料到将会需要资料时,在资料请求之前预先连续读取资...

坑哥的技术记录本 2万+

SAP B1中文培訓教材_SDK

公司内部培训资料,对开发工具 ,DIAPI, UIAPI,Add-ON有详细解说

linux命令--查看硬盘信息(磁盘阵列模式下)

如果服务器有做磁盘阵列,那么运行fdisk -l或者smartctl –all /dev/sda,得不到你要的磁盘信息。[root@localhost /]# fdisk -lWARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted. D

smithereensman的博客 3万+

IBM X3500M3阵列卡坏了|更换raid阵列卡步骤

IBM X3500M3服务器出故障了,怎么安全的更换raid阵列卡。

QQ2119459337的博客 1万+

论文阅读——You May Not Need Attention

 

vincent1y的博客 417

【NLP】You May Not Need Attention详解

废话:之前蹭上了BERT的热度,粉以个位数每天的速度增长,感谢同学们的厚爱!弄得我上周本来打算写文本分类,写了两笔又放下了,毕竟文本分类有很多SOTA模型,而我的研究还不够深入。。慢慢完善吧,今天看到一篇You may not need attention,写attention起家的我怎么能放过,立刻打印出来读了读,下面详细说一下。其实每次在写的过程中我也在思考,希望一会儿可以给自己和大家带来不同...

weixin_33772645的博客 208

MegaRAID Storage Manager RAID管理工具基本操作

MegaRAID Storage Manager RAID管理工具基本操作 知识点分析: 重要提示:配置阵列时请谨慎操作,并仔细阅读各种提示,以防误操作导致数据损失。 MegaRAID Storage Manager(以下简称为"MSM")是用于管理采用LSI(Avago/Broadcom) RAID架构阵列的图形化管理工具。 适用于: 服务器产品线 ...

清风古韵 7万+

服务器系统盘raid1同步失败,RAID1 其中一块盘failed 要怎么处理

profile:SERVER---Server IP: ******Server Name: ****OS name: Windows 2003OS Version: 5.2OS Architecture: x86Driver Name: LSI_S...

weixin_31498229的博客 2567

LSI阵列卡查看SSD寿命

   1 使用centos 6.2 等linux系统live cd引导设备。并安装LSI megacli命令包。 2 使用 MegaCli 来取得 RAID 卡下硬盘的信息: 然后使用下面的命令: 1 /opt/MegaRAID/MegaCli/MegaCli64 -PDList -aALL

撞强※非专业,更专注 6632

在曙光服务器上做raid

1、开机,按提示进入raid configuration界面 2 2、按F2选择操作动作, 3 3、删除已有的raid0、raid5 4、把原来组成raid0、raid5的磁盘一起创建新的raid5

真理部 1万+

四、Raid卡(阵列卡)

学习笔记

dynwzmba的博客 5234

CCF考试流程

作为一个计算机考研跨考生,练习了好几天,有的题来来回回看上一两个小时才能修正错误,我这正疑惑着ccf难道直接写代码提交,都没法调试的?今天才发现是可以先在编译器上调试成功后再粘贴上去提交的! 发现一个考试流程的介绍,虽然好像2019年9月改革了可以看分了什么的,但是我还是没搞清楚是全部做完了能看到分还是每一道题都可以看到分,xdm走过路过有知道的告诉我一声哦,先谢过。 这好像是个2018年的介绍,但是对什么都不懂的小白来说还是很有价值的,链接如下: CCF考试详细流程 ...

cloudless_sky的博客 2535
上一篇: CCF 201709-2 公共钥匙盒 C++ not easy
下一篇: CCF 201609-1 最大波动 C++ easy
cloudless_sky
博客等级 码龄8年 106粉丝 128原创
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值