2011蓝桥杯Java决赛 连通问题

蓝桥杯2011省赛——字符串处理(Java) 问题描述: 要求程序对用户输入的串进行处理: 1.把每个单词的首字母变为大写。 2.把数字与字母之间用下划线字符(_)分开,使得更清晰。 3.把单词中间有多个空格的调整为1个空格。 输入 输入的串中只有小写字母,空格和数字,不含其它的字母或符号。每个单词间由1个或多个空格分隔;输入的串长度不超过200个字符。 输出 样例 输入复 you and e what cpp2005program 输出 You And Me What Cpp_2005_program 输入 this is a 阅读详情

这周五要进行蓝桥杯的决赛了,把去年的题目做了一下,第五题 连通问题:分享一下:

题目:

BMP是常见的图像存储格式。
如果用来存黑白图像(颜色深度=1),则其信息比较容易读取。

与之相关的数据:

(以下偏移均是从文件头开始)
偏移:10字节, 长度4字节: 图像数据真正开始的位置。
偏移:18字节, 长度4字节: 位图的宽度,单位是像素。
偏移:22字节, 长度4字节: 位图的高度,单位是像素。

从图像数据开始处,每个像素用1个二进制位表示。
从图片的底行开始,一行一行向上存储。

Windows规定图像文件中一个扫描行所占的字节数必须是4字节的倍数,
不足的位均以 0 填充。例如,图片宽度为45像素,实际上每行会占用
8个字节。

可以通过Windows自带的画图工具生成和编辑二进制图像。
需要在“属性”中选择“黑白”,指定为二值图像。
可能需要通过 查看 | 缩放 | 自定义... 把图像变大比例一些,
更易于操作。

图像的左下角为图像数据的开始位置。白色对应1,黑色对应0

我们可以定义:两个点距离如果小于2个像素,则认为这两个点连通。
也就是说:以一个点为中心的九宫格中,围绕它的8个点与它都是连通的。
如:t1.bmp 所示,左下角的点组成一个连通的群体;
而右上角的点都是孤立的。

程序的目标是:根据给定的黑白位图,分析出所有独立连通的群体,
输出每个连通群体的面积。所谓面积,就是它含有的像素的个数。

输入数据固定存在in.bmp中。

如示例的in.bmp,
程序应该输出:
12
81
52
133

该输出表示:共有4个连通群体。
输出的连通体面积间的顺序可以随意。

请编程解决上述问题。

我们测试程序的时候,会使用不同的in.bmp文件。


要求考生把所有类写在一个文件中。
调试好后,存入与考生文件夹下对应题号的“解答.txt”中即可。
相关的工程文件不要拷入。请不要使用package语句。

另外,源程序中只能出现JDK1.5中允许的语法或调用。不能使用1.6或更高版本。







源码:

import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import javax.imageio.ImageIO;

class Dian {
	public boolean value = false;
	public boolean visited = false;
}

public class LianTong {
	public static Dian ds[][] = null;
	public static int width, height;
	public static int result = 0;
	public static int visitedNum = 0;
	public static List<Integer> nums = new ArrayList<Integer>();
	public static int num = -1;

	public static void ScanBmp(int x, int y) {
		if (x < 0 || y < 0 || x >= width || y >= height) {
			return;
		}
		if (!ds[x][y].visited) {
			ds[x][y].visited = true;
			visitedNum++;
			if (ds[x][y].value) {
				result++;

				int tempNum = nums.get(num) + 1;
				nums.set(num, tempNum);
				ScanBmp(x - 1, y);
				ScanBmp(x - 1, y - 1);
				ScanBmp(x - 1, y + 1);
				ScanBmp(x + 1, y);
				ScanBmp(x + 1, y - 1);
				ScanBmp(x + 1, y + 1);
				ScanBmp(x, y - 1);
				ScanBmp(x, y + 1);
			}
		}

	}

	public static void main(String[] args) throws IOException {
		File file = new File("in.bmp");
		BufferedImage bi = ImageIO.read(file);
		width = bi.getWidth();
		height = bi.getHeight();
		ds = new Dian[width][height];
		for (int x = 0; x < width; x++) {
			for (int y = 0; y < height; y++) {
				ds[x][y] = new Dian();
				if (bi.getRGB(x, y) == -1) {
					ds[x][y].value = false;
				} else {
					ds[x][y].value = true;
				}
			}
		}
		for (int y = 0; y < height; y++) {
			for (int x = 0; x < width; x++) {
				result = 0;
				num++;
				nums.add(0);
				ScanBmp(x, y);
				if (result == 0) {
					num--;
					if (visitedNum == height * width) {
						break;
					}
				}
			}
		}
		for (int i = 0; i < num + 1; i++) {
			System.out.println(nums.get(i));
		}
	}
}
改进版:
[code=java]
改进版
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;

class Dian {
	public boolean value = false;
	public boolean visited = false;
}

public class LianTong {
	public static Dian ds[][] = null;
	public static int width, height;
	public static int result = 0;
	public static int visitedNum = 0;

	public static void ScanBmp(int x, int y) {
		if (x < 0 || y < 0 || x >= width || y >= height) {
			return;
		}
		if (!ds[x][y].visited) {
			ds[x][y].visited = true;
			visitedNum++;
			if (ds[x][y].value) {
				result++;
				ScanBmp(x - 1, y);
				ScanBmp(x - 1, y - 1);
				ScanBmp(x - 1, y + 1);
				ScanBmp(x + 1, y);
				ScanBmp(x + 1, y - 1);
				ScanBmp(x + 1, y + 1);
				ScanBmp(x, y - 1);
				ScanBmp(x, y + 1);
			}
		}

	}

	public static void main(String[] args) throws IOException {
		File file = new File("in.bmp");
		BufferedImage bi = ImageIO.read(file);
		width = bi.getWidth();
		height = bi.getHeight();
		ds = new Dian[width][height];
		for (int x = 0; x < width; x++) {
			for (int y = 0; y < height; y++) {
				ds[x][y] = new Dian();
				if (bi.getRGB(x, y) == -1) {
					ds[x][y].value = false;
				} else {
					ds[x][y].value = true;
				}
			}
		}
		for (int y = 0; y < height; y++) {
			for (int x = 0; x < width; x++) {
				result = 0;
				ScanBmp(x, y);
				if (result == 0) {
					if (visitedNum == height * width) {
						break;
					}
				}
				else
				{
					System.out.println(result);
				}
			}
		}
	}
}
[/code]



2011蓝桥杯软件设计大赛决赛Java所有试题 2011年第二届蓝桥杯全国软件专业人才设计与开发大赛全国总决赛Java本科高职试题 立即下载

相关推荐

Jacobi正交多项式在数值分析中的应用与实现

本文深入探讨了Jacobi正交多项式在数值分析中的核心应用与实现。作为最通用的正交多项式族,Jacobi多项式通过参数α和β的调节,可退化为切比雪夫、勒让德等经典多项式,为函数逼近、奇异积分和微分方程求解提供了统一框架。文章重点解析了其在加权高斯积分(高斯-雅可比积分)和谱方法求解微分方程中的关键作用,并提供了基于递归关系和SciPy的稳定高效实现方案,帮助读者掌握这一强大的数值计算工具。

weixin_29306011的博客 262

数据结构java版五 图的应用

-图的表示_求补图 图的任何两个顶点间都有边,则称为:完全图。 从完全图中去掉本图的边所得到的图:补图。 不同的表示法如何求一个图的补图? -深度优先遍历_填空题 填空题 如图a 所示的树形结构,从根节点开始的深度遍历是:___________ 如图b 所示的图中,从a节点开始的深度遍历是:_______________        

测试搬运工 1112

避坑指南:CesiumLab+ENVI处理Sentinel-2影像数据的完整流程

本文提供了一份详细的避坑指南,完整介绍了如何利用CesiumLab和ENVI工具链,将Sentinel-2卫星影像处理成可供Cesium三维地球引擎加载的离线瓦片数据。内容涵盖数据获取、SNAP预处理、ENVI影像增强合成以及CesiumLab切片配置等全流程实战步骤与关键参数优化,旨在帮助工程师高效构建自主可控的高精度离线地图服务。

weixin_29248653的博客 300

2020年蓝桥杯Java B组第二场题目+部分个人解析

2020年蓝桥杯Java B组第二场题目+部分个人解析

m0_61811926的博客 8829

【AI Infra】Perfetto性能分析工具指南

Perfetto是一款开源性能分析工具,提供系统级和应用级的活动数据追踪功能。其界面分为四个区域:左侧操作区(包含Trace查看、SQL查询、预置分析等功能)、上方信息区、中间图形化展示区以及下方详细信息区。工具支持快捷键操作(w/s缩放、a/d移动、m标记等),并能高效处理大体积Trace文件。通过Timeline分析可发现性能瓶颈,如案例中update_actor耗时过高的问题,最终定位到CPU offloading导致的MemcpyH2D操作耗时过长,提出了优化方案。Perfetto相比Systrac

baiweizeng的博客 1536

pix4d安装步骤

pix4d三维模型软件的安装步骤

Little_Bee_27000的博客 1万+

《人人都是项目经理V2.0》读书笔记——第11章 规划风险管理——无论做什么事,总伴随风险

1. 风险和风险管理计划 在项目管理学科中,风险的定义特别强调两点:风险是不确定的;这种不确定因素对项目有影响。风险管理在生活中常叫做“危机管理”。 事物发展都有不确定性。如果向有利的方向发展,则称之为“机会”,反之则叫做“威胁”。 风险的特点 风险的最大特点就是随时在变。比如,股价波动对于不炒股的人而言不是风险;对于手中持有股票的人而言,股价涨跌分别意味着机会和威胁;而对于无股、想买股票的人而...

EthanAndEvan的博客 844

C++结合大漠插件实现DNF自动化脚本:从原理到实战

自动化技术通过模拟用户操作,实现重复性任务的自动执行,其核心原理在于对系统输入输出接口的精确控制。在Windows平台,这通常涉及窗口管理、图像识别与键鼠模拟等技术。这些技术为软件自动化测试、办公流程自动化及特定场景的辅助工具开发提供了工程实践基础。大漠插件作为国内广泛使用的Windows自动化开发组件,封装了上述底层操作,显著降低了开发门槛。通过其提供的COM接口,开发者可以高效实现窗口绑定、后台找图找色及内存读写等关键功能。本文以《地下城与勇士》为例,详细解析如何利用C++集成大漠插件,构建一个稳定、高

weixin_34185512的博客 598

2011蓝桥杯java,2011蓝桥杯Java决赛 连通问题

这周五要进行蓝桥杯的决赛了,把去年的题目做了一下,第五题 连通问题:分享一下:题目:BMP是常见的图像存储格式。如果用来存黑白图像(颜色深度=1),则其信息比较容易读取。与之相关的数据:(以下偏移均是从文件头开始)偏移:10字节, 长度4字节: 图像数据真正开始的位置。偏移:18字节, 长度4字节: 位图的宽度,单位是像素。偏移:22字节, 长度4字节: 位图的高度,单位是像素。从图像数据开始处,...

weixin_39955423的博客 195

Arduino、ESP32驱动BMP390L数字大气压传感器(压力传感器)

BMP390L是一款博世新研发的工业级专用数字气压传感器,具有极高的温度稳定性、低漂移、低功耗。

不脱发的程序猿 2023

【车载以太网测试从入门到精通】系列文章目录汇总

物理层测试、数据链路层测试、以太网交换机测试、网络层测试、传输层测试、以太网TCP/IP协议自动化测试、以太网网络管理测试、以太网网络管理自动化测试、鲁棒性测试、SOME/IP测试、SOMEI/IP服务接口自动化测试、DoIP诊断测试、DoIP诊断自动化测试、DoIP BootLoader刷写、以太网网关路由测试、以太网网关路由自动化测试、AVB测试。

测试领域技术分享 3175

算法笔记_199:第二届蓝桥杯软件类决赛真题(C语言本科)

  前言:以下代码部分仅供参考,C语言解答部分全部来自网友,Java语言部分部分参考自网友,对于答案的正确性不能完全保证。   试题1   数论中有著名的四方定理:所有自然数至多只要用四个数的平方和就可以表示。 我们可以通过计算机验证其在有限范围的正确性。 对于大数,简单的循环嵌套是不适宜的。下面的代码给出了一种分解方案。 请仔细阅读,填写空缺的代码(下划线部分)。...

weixin_34343308的博客 149

SAP 发票凭证反向冲销

发票凭证反向冲销: 业务模拟: MIRO发票校验后,生成发票凭证号: 事务代码MR8M,输入凭证号码,反向冲销(类似于MIGO入库后的反向冲销): 此时进入MIRO查看,发现冲销成功,可以再次做MIRO发票校验: ...

willieyuan的博客 7727

第十一届蓝桥杯——JAVA组真题

第十一届蓝桥杯——JAVA组真题

weixin_59796310的博客 2万+

霍尼韦尔SoftMaster使用说明

霍尼韦尔SoftMaster使用说明

Camera2Demo

在Camera2 的基础上进行封装,使得Camera2一堆初始化逻辑与Activity分离,降低耦合度,完成预览拍照并保存的操作

读取in.bmp文件,判断其中哪些点是连通的

读取in.bmp文件,判断其中哪些点是连通的,并求各个连通分量的面积

忆灬凝的博客 474

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

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

2011蓝桥杯java试题及部分参考答案

此文由老猫整理,转载请注明出处:http://blog.csdn.net/nthack5730/article/details/49841549 更多有关老猫的文章:http://blog.csdn.net/nthack5730

机智猫 1万+

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

解析bmp图像(某年全国软件大赛题目)

题目: BMP是常见的图像存储格式。 如果用来存黑白图像(颜色深度=1),则其信息比较容易读取。 与之相关的数据: (以下偏移均是从文件头开始) 偏移:10字节, 长度4字节: 图像数据真正开始的位置。 偏移:18字节, 长度4字节: 位图的宽度,单位是像素。 偏移:22字节, 长度4字节: 位图的高度,单位是像素。 从图像数据开始处,每个像素用1个二进制位表示。 从图片的底...

weixin_30339457的博客 212

蓝桥杯_连通性

一、完整代码: import util.*; public class Main { static boolean dfs(char[][] map, int y1, int x1, int y2, int x2) { if(y1 == y2 && x1 == x2) return true; char old = map[y1][...

weixin_38170862的博客 293

全球变暖dfs

题目描述 你有一张某海域NxN像素的照片,"."表示海洋、"#"表示陆地,如下所示: ....... .##.... .##.... ....##. ..####. ...###. ....... 其中"上下左右"四个方向上连在一起的一片陆地组成一座岛屿。例如上图就有 2 座岛屿。 由于全球变暖导致了海面上升,科学家预测未来几十年,岛屿边缘一个像素的范围会被海水淹没。具体来说如果一块陆地像素与海洋相邻(上下左右四个相邻像素中有海洋),它就会被淹没。 例如上图中的海域未来会变成如下样子:

qq_53770580的博客 1659

蓝桥杯 四方定理 递归

数论中有著名的四方定理:所有自然数至多只要用四个数的平方和就可以表示。 我们可以通过计算机验证其在有限范围的正确性。 对于大数,简单的循环嵌套是不适宜的。下面的代码给出了一种分解方案。 请仔细阅读,填写空缺的代码(下划线部分)。 注意:请把填空的答案(仅填空处的答案,不包括题面)存入考生文件夹下对应题号的“解答.txt”中即可。 直接写在题面中不能得分。 #include #incl

vinci_lau的专栏 4361

2012蓝桥杯初赛试题(本科组)

由于篇幅较长,解析放在下篇博文里。在此,谢谢DD提供题。 第一题: 微生物增殖 假设有两种微生物 X 和 Y X出生后每隔3分钟分裂一次(数目加倍),Y出生后每隔2分钟分裂一次(数目加倍)。 一个新出生的X,半分钟之后吃掉1个Y,并且,从此开始,每隔1分钟吃1个Y。 现在已知有新出生的 X=10, Y=89,求60分钟后Y的数目。 如果X=10,Y=90 呢? 本题的要求...

java开发指南博客 【转载】 317

c语言bmp找红点,[蓝桥杯][2013年第四届真题]打印十字图-题解(C语言代码)---图文(超容易理解)...

#####找规律:以“$”为红点,连线起来即为下图,不难得出总行数总列数均为t=4n+5(正方形),总行数列数一定为奇数,很容易确定最中间的点为a[t/2][t/2]。![](/image_editor_upload/20200215044635_79242.jpg)#####由于n为正整数,由内向外一定有最中间的红十字线和第一层红十字,接下来找每一层的规律。![](/image_editor_u...

weixin_33987275的博客 177

Hive常见的存储格式文件比较

一 列式存储和行式存储 首先我们看一下一张表的存储格式 1.1 行式存储 1.2 列式存储 1.3列式存储和行式存储的比较 行式存储 优点: #相关的数据是保存在一起,比较符合面向对象的思维,因为一行数据就是一条记录 #这种存储格式比较方便进行INSERT/UPDATE操作 缺点: #如果查询只涉及某几个列,它会把整行数据都读取出来,不能跳过不必

happy19870612's blog 1万+

java实现第二届蓝桥杯异或加密法

异或加密法. 在对文本进行简单加密的时候,可以选择用一个n位的二进制数,对原文进行异或运算。 解密的方法就是再执行一次同样的操作。 加密过程中n位二进制数会循环使用。并且其长度也可能不是8的整数倍。 下面的代码演示了如何实现该功能。 请仔细阅读,填写空缺的代码(下划线部分)。 void f(char* buf, unsigned char* uckey, int n) { int i; ...

南 墙 1万+
上一篇: 7 款基于 JavaScript/AJAX 的文件上传插件
下一篇: 告别繁琐的配置文件 ---- 全注解Spring,Hibernate开发 不完全指南
逆乾坤
博客等级 码龄16年 30粉丝 18原创
评论 3
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值
⌂ 换网址