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

C#方法设计最佳实践:粒度、异常、访问性与重构指南 方法是软件工程中最基础的可执行单元,其设计质量直接决定代码可维护性、线程安全性与团队协作效率。从认知科学视角看,30行限制本质是对人类短期记忆负荷的工程约束;异常处理需依循上下文契约——静态构造函数必须沉默以保障类型可用性,析构函数严禁抛出异常,属性Getter应杜绝副作用。C#中方法签名设计需兼顾PascalCase命名规范与动词+名词语义表达,访问修饰符实为模块演进的契约防火墙。结合virtual/override语义、Dispose模式协同及静态/实例方法选型原则,本文系统梳理高危陷阱(如构造函数调用 阅读详情
题目描述:

    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, each starts with a pair of positive integers M and N (≤10) which are the number of rows and columns of the matrices, respectively. Then 2*M lines follow, each contains N integers in [-100, 100], separated by a space. The first M lines correspond to the elements of A and the second M lines to that of B.

    The input is terminated by a zero M and that case must NOT be processed.

输出:

    For each test case you should output in one line the total number of zero rows and columns of A+B.

样例输入:
2 2
1 1
1 1
-1 -1
10 9
2 3
1 2 3
4 5 6
-1 -2 -3
-4 -5 -6
0
样例输出:
1
5

AC代码:

#include<iostream>
using namespace std;

int main(){
	int i,j,m,n,num,flag,num1[10][10],num2[10][10],result[10][10];

	while(cin>>m){
		if(m==0)
			break;
		cin>>n;
		for(i=0;i<m;i++)
			for(j=0;j<n;j++)
				cin>>num1[i][j];
		for(i=0;i<m;i++)
			for(j=0;j<n;j++)
				cin>>num2[i][j];
		
		/*for(i=0;i<m;i++)
			for(j=0;j<n;j++)
				result[i][j]=num1[i][j]+num2[i][j];
		*/

		num=0;
		for(i=0;i<m;i++){
			flag=0;
			for(j=0;j<n;j++)
				if(num1[i][j]+num2[i][j]){
					flag=1;
					break;
				}
			if(flag==0)
				num++;
		}

		for(i=0;i<n;i++){
			flag=0;		
			for(j=0;j<m;j++)
				if(num1[j][i]+num2[j][i])
				{
					flag=1;
					break;
				}	
			if(flag==0)
				num++;
		}
		cout<<num<<endl;
	}
}


2026年AI编程工具选型实战指南:TRAE、Copilot、Windsurf与通义灵码深度对比 AI编程工具是现代软件开发中提升编码效率的关键基础设施,其本质是基于大语言模型的代码理解与生成系统,通过提示工程、上下文感知和知识检索等技术实现智能补全、重构与测试生成。技术价值不仅在于加速开发,更在于支撑DevSecOps流程合规性、信创环境适配性及企业级代码可追溯性。典型应用场景涵盖Java微服务(Spring生态)、前端工程化(Vue3/React+TS类型推导)、全栈契约一致性校验,以及金融、政务等高安全要求领域。本文聚焦TRAE Solo本地推理架构与GitHub Copilot云端直连模式的核心 阅读详情

相关推荐

游戏测试面试题

工具:Charles(Throttle)、Clumsy、QNET、iOS Network Link Conditioner、ATC(Facebook)如角色等级 1-100,有效类是 [1,100],无效类是 0、101、负数、小数、字符串。常用:clone、add、commit、push、pull、branch、checkout、merge、rebase、stash。另外有:Duplicate(重复)、Invalid(无效)、Won't Fix(不修复)、Deferred(延期)。

Ssissi_的博客 301

python USB 模块加载错误,

python 加载usb.core 错误,只需要安装下面即可。网上那么多重复的内容大多不靠谱。

jilong17的专栏 835

libusb-win32-devel-filter-1.2.6.0

setool 最新刷机工具,win7系统的USB驱动

调用pyusb出现No backend available报错的解决办法

[转载]解决pyusb报错

学习笔记 1万+

libusb-win32-devel-filter-1.2.6.0(1).exe

双击安装,选择对应的usb接口,install ,生成 LibUSB-Win32 文件夹,(一路next就不贴图了) 在LibUSB-Win32 文件夹下的bin目录下,点击inf-wizard安装驱动,生成USB驱动信息,保存在任意目录下。

libusb-win32-1.2.6.0

libusb-win32-1.2.6.0开发的相关资料,包括的工具很全,包括源代码。

zcmu 2188 Frames(逻辑题)

思路:各种情况的判断,逻辑题一定要重视啊。。。2018年浙江省省赛麻将题了解一下(干死了好多队啊,好像都变成银牌题了) 代码如下: #include &lt;iostream&gt; #include&lt;algorithm&gt; #include&lt;cmath&gt; #include&lt;math.h&gt; #include&lt;stdio.h&gt; #include&l...

摆渡人的博客 281

libusb-win32

libusb-win32

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 several test cases, each star

无知的我 1919

IDEA集成selenium自动化测试(Java+Selenuim+testNG+Maven)

文章目录写在前面01 | 新建Maven项目02 | idea集成Selenium03 | 写在前面 因为软件测试的需求和博主比较经常使用Java,于是,想在Idea中集成selenuim,用Java编写测试代码,因此有了这篇文章来记录一下过程。 资源指路: java使用selenium实现模拟浏览器操作API大全 模拟登录 TestNG入门教程 感谢上面博客的大佬。 01 | 新建Maven项目 不使用骨架创建,直接点击左侧Maven,然后一路next即可。 02 | idea集成Sele

aLinxi的博客 8279

IOS APP上架被拒 4.3(a) - Design - Spam,成功

成功解决IOS APP上架被拒 4.3(a) - Design - Spam,本篇博客记录了详细过程

qq_40147106的博客 6909

安装 USBASP的正确方式

摘要: 本文记录了在Win11系统下解决USBASP驱动安装问题的过程。作者自制AVR下载电路后,发现PROGISP软件无法识别编程器,原因是未选择libusb_win32驱动选项。重新安装驱动后,编程器成功在线。随后测试MEGA8单片机编程时,通过调整SPI接口连接方式并重新设计电路板,最终实现稳定读写功能。关键点包括:驱动安装需配置libusb_win32、SPI接口需直连(非交叉),以及驱动重装可解决突发连接问题。实验验证了自制模块的可行性。(149字)

TSINGHUAJOKING 1350

USB通讯速度翻倍秘诀:手把手教你用WinUsb替代HID协议(附Zadig驱动配置图解)

本文详细介绍了如何通过WinUsb技术替代传统HID协议,实现USB通讯速度的显著提升。从技术对比、实现原理到Zadig驱动配置图解,手把手教你完成免驱高速通讯方案,适用于数据采集、固件升级等场景,实测速度可达HID协议的2倍以上。

weixin_29168675的博客 134

USBASP驱动程序在WIN10系统下的安装

心头一热,把用了多年的win7系统换到了win10系统。换系统的热劲还没过,就让51单片机给泼了盆冷水。自制克隆的USBASP驱动装不上了。试图用JTAGICE来烧写,测试几次都不成功。当然JTAGICE也是克隆的。不知道问题出在什么地方,所以又开始折腾USBSAP。在网上发现“zading“这款软件可以实现,经过测试完美解决问题。现在将具体过程和软件分享出来,以飨读者! 1. USBA...

1万+

RAGFlow 离线部署:解决cl100k_base.tiktoken问题

摘要 本文详细解决了RAGFlow离线部署时tiktoken缓存文件下载失败的问题。通过分析tiktoken库的缓存机制,一次性不改代码解决.

baidu_25691461的博客 830

052、联发科Imagiq HyperEngine架构适配:天玑9000/9200的ISP多核并行调度与Tuning Toolkit调优案例

摘要: 项目组在适配联发科天玑9200的Imagiq 890 ISP架构时,遇到多摄预览功耗过高、帧率不稳等问题。通过分析多核调度机制,调整辅核QoS通道、优化AI-ISP协同模式(采用FREERUN+运动补偿),并利用Tuning Toolkit的Pipeline Viewer动态分配负载,最终降低功耗30mA、提升画质。关键经验包括:避免多核带宽冲突、合理配置动态时钟策略,以及统一校准参数版本管理。天玑9000/9200的HyperEngine架构需优先理解多核协同逻辑,再针对性调优,否则易引发场景兼容

zzfmlxs的博客 36

LibUSB-Win32 开发工具包安装说明

LibUSB-Win32 开发工具包安装说明 【下载地址】LibUSB-Win32开发工具包安装说明 LibUSB-Win32 开发工具包为开发者提供了便捷的 USB 设备驱动开发环境。通过简单的安装步骤,用户可以快速配置 USB 接口并生成所需的驱动信息。该工具包支持多种 USB 设备,兼容性强,安装过程简洁明了,无需...

gitblog_06713的博客 1524

知识图谱开发实战:搭建上市公司知识图谱(二)

搭建上市公司知识图谱(二)学习目标1. 获取上市公司公开数据1.1 获取上市公司列表与行业信息1.2 代码展示2. 从网站爬取上市公司网页并存储为 HTML文件2.1 准备环境2.2 爬取上市公司公开信息3. 解析HTML文件,获取高管信息并存储为 csv 文件4. 设计知识图谱数据库4.1 实体4.2 关系4.3 属性4.4 特殊4.5 代码5. 知识图谱数据库查询实战5.1 实战:按照neo4j的数据格式,转换CSV文件5.2 实战:使用neo4j-admin 导入数据5.3 实战:使用neo4j-b

全网粉丝30W+,优快云、稀土掘金人工智能领域签约作者,人工智能、大模型、Python 爬虫,商务合作,请私信沟通。 2094

嵌入式USB上位机的制作

1、首先生成MFC应用程序。 2、然后把usb的程序加进去。 3、安装生成USB驱动的程序。 libusb-win32-devel-filter-1.2.6.0.exe 上面是USB的生成工具,输入在网上可以下到。 最后搞定。

宁静以致墨的专栏 1807

大数据分析案例-基于随机森林算法构建二手房价格预测模型

通过应用随机森林算法,我们希望建立一个能够有效预测二手房价格的模型。这个模型可以基于各种因素,如区域位置、房屋属性、市场供需等,来预测未来某一时间点的房价。通过提高预测准确性,我们可以更好地把握房地产市场动态,为决策提供更有价值的参考。揭示影响二手房价格的因素及其影响方式:通过分析随机森林算法生成的模型,我们可以进一步了解哪些因素对二手房价格有重要影响,以及这些因素如何影响房价。这有助于我们深入理解房地产市场的运行规律,为制定更为有效的市场策略提供依据。

m0_64336780的博客 1万+

lammps 案例in文件汇总

进阶案例: 聚乙烯和石墨烯界面pull out模拟代码 反应力场reax/c设置方法及案例解析 石墨烯热导率模拟代码(NEMD方法) 圆锥形SiC纳米磨削单晶硅源代码 高熵合金FeNiCrCoCu纳米压痕模拟代码 fix indent命令实现纳米摩擦及摩擦力计算 Fe原子辐照轰击多层石墨烯模拟代码 铝基石墨烯复合物压缩变形in文件源代码 石墨烯自动卷曲到Fe纳米线模拟源代码 铝/石墨烯复合物结晶过程lammps模

lammps_jiayou的博客 9446

三步,在Win11系统下使用USBASP,不用重启不用配置

2.之后按照图上这样,选择USBasp以及libusb-win32,并且点击Install Driver。这时候你的设备管理器会出现一个带感叹号的USBasp,并且不能更新驱动。事情是这样,我遇到了这个问题,之前买的USBASP现在打不上驱动。1.3.我们需要一个小工具,网上搜索并且下载Zadig。实际上很简单,你需要先把USBASP这个插到电脑上面。3.再回去看,可以看到已经打好 驱动了。最后附带一下USBASP的引脚定义。

arenascat的博客 5573

汉书HE8,好用的汇编代码编写工具

汉书HE8,好用的汇编代码编写工具早期编写汇编代码所用功能强大

libusb-win32显式调用与隐式调用

转载自http://blog.sina.com.cn/s/blog_63447c1f01012rvf.html 一、visual_studio_2010编译libusb-win32  libusb-win32-src-1.2.6.0.zip   http://sourceforge.net/apps/trac/libusb-win32/wiki testlibusb是测试界面、调

jiong_1988的专栏 4090

深度学习工具包 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")

OV9734 DATASHEET,完整规格书

OV9734完整规格书,包括电气参数,尺寸规格,寄存器配置表等

Win10安装libusb-win32遇到的相关问题

这是因为libusb-win32驱动程序的签名认证未做造成的。在默认的情况下,系统对驱动程序强制签名认证。1.正常进入系统点击开始按钮,选择电源。此时先按住键盘上的shift键,再点击“重启”;(注:如无法正常进入系统,可在开机出现LOGO时强制关机三次来触发修复模式,再进入高级选项)2.重启后进入选单,首先选择“疑难解答”;3.再选择“高级选项“;4.进入高级选项之后,我们就可以进行我们需要的操作,点击启动设置;

Magicamazing的博客 9687

IEM模型,地表粗糙度模拟

利用微波反演土壤水分时候,利用IEM模型可以实现对随机地表的模拟

Python 双目摄像机控制(windows + linux)

需要安装libwebcam库,debian 系可以通过apt安装,centos的安装方法如下。安装,在弹出框中选择摄像机usb设备。

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

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值