2011年浙江大学计算机及软件工程研究生机试真题(3)

Sentinel--哨兵系列数据下载地址及流程更新【202310】 哨兵系列数据下载地址及流程更新。哨兵系列卫星作为哥白尼计划的一部分,主要目标便是对地球的观测任务。哥白尼计划由三部分组成:空间部分(哨兵系列太空任务与其他太空机构任务)、测量部分(提供海洋、大陆表面和大气信息的陆基和机载数据收集网络)、数据管理与全球共享。 阅读详情
题目描述:

    Given an increasing sequence S of N integers, the median is the number at the middle position. For example, the median of S1={11, 12, 13, 14} is 12, and the median of S2={9, 10, 15, 16, 17} is 15. The median of two sequences is defined to be the median of the non-decreasing sequence which contains all the elements of both sequences. For example, the median of S1 and S2 is 13.
    Given two increasing sequences of integers, you are asked to find their median.

输入:

    Each input file may contain more than one test case.
    Each case occupies 2 lines, each gives the information of a sequence. For each sequence, the first positive integer N (≤1000000) is the size of that sequence. Then N integers follow, separated by a space.
    It is guaranteed that all the integers are in the range of long int.

输出:

    For each test case you should output the median of the two given sequences in a line.

样例输入:
4 11 12 13 14
5 9 10 15 16 17
样例输出:
13

AC代码:

#include<iostream>
#include<algorithm>
#define maxsize 2000001
using namespace std;
long num[maxsize];

int main(){
	long i,n1,n2;

	while(cin>>n1){
		for(i=0;i<n1;i++)
			cin>>num[i];
		cin>>n2;
		for(i=n1;i<n2+n1;i++)
			cin>>num[i];
		sort(num,num+n1+n2);
		cout<<num[(n1+n2-1)/2]<<endl;
	}
}

将数组num定义为全局变量
STM32H743的FDCAN使用方法(1):STM32CubeMX初始化代码生成 STM32H743的FDCAN使用方法(1):STM32CubeMX初始化代码生成。 阅读详情

相关推荐

QMT实盘避坑指南:从环境配置到策略部署的完整流程(含国金证券路径设置)

本文是一份详尽的QMT实盘交易避坑指南,重点解析了从环境配置到策略部署的完整流程。针对国金证券QMT平台,文章深入剖析了核心架构、精准路径配置、关键参数解析、交易操作实战及异常处理,并提供了策略部署、监控与日志构建的完整方案,旨在帮助具备Python基础的开发者规避常见陷阱,实现稳定可靠的实盘交易。

weixin_29309475的博客 592

PAT 甲级 1029  Median

1029 Median (25 point(s)) Given an increasing sequence S of N integers, the median is the number at the middle position. For example, the median of S1 = { 11, 12, 13, 14 } is 12, and the median of S2...

漫浸天空的雨色的备忘录~ 774

C#上位机+YOLO实时目标检测:摄像头采集+多线程推理+精度调优全流程

标注数据集:使用LabelImg工具标注目标对象,按YOLO格式整理数据集;模型训练:使用Ultralytics库训练自定义模型,提升特定目标的检测精度;训练参数优化:增加训练轮数(epochs=100200)、调整批次大小(batch=1632)、使用数据增强(flip、mosaic等)。摄像头采集:封装通用采集类,支持USB摄像头/网口相机,实现稳定帧读取与异常处理;多线程推理:采用“采集线程+推理线程+UI线程”解耦架构,使用线程安全队列传递帧数据,彻底解决界面卡顿;核心封装。

这里只有干货:从 Modbus 通信到 MES 对接,从 YOLO 训练到工控机部署,带你搞定工业软件开发全流程。 673

1029 Median (25 分) 归并 内存限制

1029Median(25分) Given an increasing sequence S of N integers, the median is the number at the middle position. For example, the median of S1 = { 11, 12, 13, 14 } is 12, and the median of S2 = { 9,...

树叶子的博客 402

R语言glm函数构建二分类logistic回归模型、epiDisplay包logistic.display函数获取模型汇总统计信息(自变量初始和调整后的优势比及置信区间,回归系数的Wald检验的p值

R语言glm函数构建二分类logistic回归模型(family参数为binomial)、使用epiDisplay包logistic.display函数获取模型汇总统计信息(自变量初始和调整后的优势比及置信区间,回归系数的Wald检验的p值)

statistics+insight+vista+power 1397

会员管理小程序实战开发04-用户登录及注册

上一节我们介绍了用户信息数据源的创建及网格布局的使用,本节的话我们讲解用户的登录及注册功能任何开发。 在我们前述章节里介绍的,不论是管理员表还是用户表,都涉及到一个问题就是openid,那这个openid如何获取呢?如果我直接把代码贴给你,就缺失了一个思考的过程。既然这个是微信提出的概念,那么必然就会有官方文档作为对应。程序开发的基本功就是要会看官方文档,很多初学的开发同学可能会对官方文档颇有诟病,觉得不够基础。怎么说呢,当你进入到开发岗之后,自学能力是必要的,还是要试着可以看懂官方文档才好。 登录接口解读

低代码布道师的博客 1567

1029 Median (25分)

Given an increasing sequence S of N integers, the median is the number at the middle position. For example, the median of S1 = { 11, 12, 13, 14 } is 12, and the median of S2 = { 9, 10, 15, 16, 17 } is...

weixin_45367847的博客 175

AD22里面封装修改后,同步到PCB图里面

【摘要】本文介绍了Altium Designer 22中同步更新元件封装的三种方法:1)从PCB库直接更新:在PCB库面板右键选择"Update PCB With[封装名]";2)通过原理图标准更新:使用Design->Update PCB Document菜单;3)在PCB编辑器中验证更新:通过Tools->Update From PCB Libraries菜单。所有方法最终都需通过ECO(工程变更订单)确认变更,建议执行前仔细核对变更内容。这些方法适用于AD22及早期版本

whm128的博客 1762

题目1004:Median(数组Merge)

题目1004:Median 时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:1716 解决:432 题目描述:     Given an increasing sequence S of N integers, the median is the number at the middle position. For examp

Rachel Zhang的专栏 4336

UNET改进77:全网首发-添加CFBlock |

本文介绍了在UNet模型中集成CFBlock注意力机制的实现方法。主要分为三个步骤:1) 创建CFBlock模块,包含卷积注意力机制和MLP;2) 在UNet连接处添加注意力模块;3) 在卷积层中嵌入注意力机制。具体实现包括:定义Conv、MLP和ConvolutionalAttention等基础模块,构建CFBlock核心结构;在UNet跳跃连接处插入注意力模块;将注意力机制整合到DoubleConv和Down模块中。该方法通过在不同位置引入注意力机制,可有效提升模型的特征提取能力。代码实现使用PyTor

AIcurator的博客 388

YOLOv11低照度增强主干网络PE-YOLO:原理与完整实现教程

编码器部分# 解码器部分self.dec_conv2 = nn.Conv2d(512, 128, 3, padding=1) # 跳跃连接self.dec_conv3 = nn.Conv2d(256, 64, 3, padding=1) # 跳跃连接self.dec_conv4 = nn.Conv2d(128, 32, 3, padding=1) # 跳跃连接# 编码路径# 解码路径(带跳跃连接)

FJN110的博客 725

1029. Median (25)-PAT甲级真题(two points)

1029. Median (25)Given an increasing sequence S of N integers, the median is the number at the middle position. For example, the median of S1={11, 12, 13, 14} is 12, and the median of S2={9, 10, 15, 1...

柳婼 の blog 2435

网络工程师如何利用Python自动Telnet到N个路由器并执行配置?

telnetlib是Python标准库中的一个模块,专门用于实现Telnet协议。通过telnetlib,我们可以方便地与支持Telnet协议的远程设备进行通信。telnetlib提供了基本的Telnet功能,如连接远程主机、发送命令、读取响应等,使得编写Telnet自动化脚本变得非常简单。文档:可以选择中文:虽然telnetlib的功能相对基础,但对于大多数Telnet操作来说已经足够。通过telnetlib,可以轻松地实现与网络设备的交互,完成自动化配置任务。

网络技术联盟站 298

2010年浙江大学计算机及软件工程研究生机试真题

http://ac.jobdu.com/problem.php?pid=1006 ZOJ问题 /* 若azbjc 能AC,则azbojac也能AC,其中a,b,c为N个'o'或者为空; 这里azbojac和azbjc相比 z和j中间+了一个o j后面就+了一个a 而z前面也有一个a 以此类推 如果再执行一次这个规定 那么z和j中间就+了2个o 后面也+了2个前面的a ... 所以z前面

Hackbuteer1的专栏 3238

VC中sqlite的使用

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

计算机控制技术及应用

《计算机控制技术及应用》通过总结作者的科研成果和吸收国内外的先进理论、方法和技术,以计算机控制系统的网络化、开放化、智能化和集成化发展趋势为主线索,主要介绍计算机控制系统的基本概念和计算机控制系统的典型形式,计算机控制系统的数学描述与基本分析方法,以及数字PID控制器、最少拍控制系统、达林算法、状态变量设计法等设计方法及其各种改进算法。重点突出计算机控制系统输入输出通道接口的设计方法和典型控制系统的设计案例与实现方法等。

2011年浙江大学计算机及软件工程研究生机试真题(1)

题目描述:     This time, you are supposed to find A+B where A and B are two matrices, and then count the number of zero rows and columns. 输入:     The input consists of several test cases, eac

windowsshaking的专栏 2166

深度学习工具包 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&#39;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(&#39;DeepLearnToolbox&#39;));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(&#39;state&#39;,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&#39;); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand(&#39;state&#39;,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 = &#39;sigm&#39;;%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, &#39;Too big error&#39;);```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(&#39;state&#39;,0)sae = saesetup([784 100]);sae.ae{1}.activation_function = &#39;sigm&#39;;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)&#39;)% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = &#39;sigm&#39;;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, &#39;Too big error&#39;);```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x&#39;,28,28,60000))/255;test_x = double(reshape(test_x&#39;,28,28,10000))/255;train_y = double(train_y&#39;);test_y = double(test_y&#39;);%% 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&#39;ll get around 1.2% errorrand(&#39;state&#39;,0)cnn.layers = { struct(&#39;type&#39;, &#39;i&#39;) %input layer struct(&#39;type&#39;, &#39;c&#39;, &#39;outputmaps&#39;, 6, &#39;kernelsize&#39;, 5) %convolution layer struct(&#39;type&#39;, &#39;s&#39;, &#39;scale&#39;, 2) %sub sampling layer struct(&#39;type&#39;, &#39;c&#39;, &#39;outputmaps&#39;, 12, &#39;kernelsize&#39;, 5) %convolution layer struct(&#39;type&#39;, &#39;s&#39;, &#39;scale&#39;, 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, &#39;Too big error&#39;);```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(&#39;state&#39;,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, &#39;Too big error&#39;);%% ex2 neural net with L2 weight decayrand(&#39;state&#39;,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, &#39;Too big error&#39;);%% ex3 neural net with dropoutrand(&#39;state&#39;,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, &#39;Too big error&#39;);%% ex4 neural net with sigmoid activation functionrand(&#39;state&#39;,0)nn = nnsetup([784 100 10]);nn.activation_function = &#39;sigm&#39;; % 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, &#39;Too big error&#39;);%% ex5 plotting functionalityrand(&#39;state&#39;,0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = &#39;softmax&#39;; % 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, &#39;Too big error&#39;);%% 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(&#39;state&#39;,0)nn = nnsetup([784 20 10]); nn.output = &#39;softmax&#39;; % 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, &#39;Too big error&#39;);```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

2011年浙江大学计算机及软件工程研究生机试真题

题目1001:A+B for Matrices 题目描述:     This time, you are supposed to find A+B where A and B are two matrices, and then count the number of zero rows and columns. 输入:     The input consists of

acm_JL的博客 2574

Statistics and Machine Learning Toolbox

Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具

2011年浙江大学计算机及软件工程研究生机试真题(2)

题目描述:     Grading hundreds of thousands of Graduate Entrance Exams is a hard work. It is even harder to design a process to make the results as fair as possible. One way is to assign each exam prob

windowsshaking的专栏 1460

大一计算机考试ppt题乌镇,九度oj 1006 ZOJ问题 2010年浙江大学计算机及软件工程研究生机试真题...

题目1006:ZOJ问题时间限制:1 秒内存限制:32 兆特殊判题:否提交:16244解决:2742题目描述:对给定的字符串(只包含'z','o','j'三种字符),判断他是否能AC。是否AC的规则如下: 1. zoj能AC; 2. 若字符串形式为xzojx,则也能AC,其中x可以是N个'o' 或者为空; 3. 若azbjc 能AC,则azbojac也能AC,其中a,b,c为N个'o'或者为空;输...

weixin_42400518的博客 380

zju2011 Median

http://ac.jobdu.com/problem.php?pid=1004#include int a[1100005],b[1100005]; int main() { int n,m,i,j,num,mid,ans; while (scanf("%d",&n)!=EOF) { for (i=0;i<n;i++) { scanf("%d",&a[i]);

zz的专栏 563

题目1007:奥运排序问题 2010年浙江大学计算机及软件工程研究生机试真题

题目描述: 按要求,给国家进行排名。 输入: 有多组数据。 第一行给出国家数N,要求排名的国家数M,国家号从0到N-1。 第二行开始的N行给定国家或地区的奥运金牌数,奖牌数,人口数(百万)。 接下来一行给出M个国家号。 输出: 排序有4种方式: 金牌总数 奖牌总数 金牌人口比例 奖牌人口比例  对每个国家给出最佳排名排名方式 和 最终排名 格式为: 排名:排

ZJFCLH的专栏 1216

1002 Grading(2011年浙江大学计算机及软件工程研究生机试真题)

题目描述:     Grading hundreds of thousands of Graduate Entrance Exams is a hard work. It is even harder to design a process to make the results as fair as possible. One way is to assign each exam prob

Sunshine 1338

题目1002:Grading 2011年浙江大学计算机及软件工程研究生机试真题

Grading 2011年浙江大学计算机及软件工程研究生机试真题 Grading hundreds of thousands of Graduate Entrance Exams is a hard work. It is even harder to design a process to make the results as fair as possible. One way is to assign each exam problem to 3 independent experts. If the

ZJFCLH的专栏 1510

zju2011:grade

http://ac.jobdu.com/problem.php?pid=1002 2011年浙江大学计算机及软件工程研究生机试真题 1、fabs------求浮点数的绝对值 2、求几个值得最大值的小技巧,max函数嵌套 #include #include double max1(double a,double b) { return a>b?a:b; } double

zz的专栏 576

1004 Median(2011年浙江大学计算机及软件工程研究生机试真题)

题目描述:     Given an increasing sequence S of N integers, the median is the number at the middle position. For example, the median of S1={11, 12, 13, 14} is 12, and the median of S2={9, 10, 15, 16, 1

Sunshine 1248

九度oj 1004 Median 2011年浙江大学计算机及软件工程研究生机试真题

题目1004:Median 时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:14162 解决:3887 题目描述: Given an increasing sequence S of N integers, the median is the number at the middle position. For example, the median o...

weixin_30711917的博客 105

题目1004:Median 2011年浙江大学计算机及软件工程研究生机试真题

题目描述: S1={11, 12, 13, 14} is 12, S2={9, 10, 15, 16, 17} is 15. 输入: 输入:若干升序序列,每个序列两行,第一个数字表示数组元素个数。 输出: 每一个case中两个序列的中位数。样例输入: 4 11 12 13 14 5 9 10 15 16 17 样例输出: 13解题思路:把两个有序数组合并,sort,

qq_25721099的博客 471
上一篇: 2010年浙江大学计算机及软件工程研究生机试真题(1)
windowsshaking
博客等级 码龄16年 11粉丝 27原创
评论 2
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值