历届试题 核桃的数量

1503142303-蓝桥杯-历届试题 核桃的数量 历届试题 核桃的数量   时间限制:1.0s   内存限制:256.0MB        问题描述 小张是软件项目经理,他带领3个开发组。工期紧,今天都在加班呢。为鼓舞士气,小张打算给每个组发一袋核桃(据传言能补脑)。他的要求是: 1. 各组的核桃数量必须相同 2. 各组内必须能平分核桃(当然是不能打碎的) 3. 尽量提供满足1,2条件的最小数 阅读详情

@ 蓝桥杯 练习系统 历届试题 PREV-1

资源限制

时间限制:1.0s 内存限制:256.0MB


问题描述

小张是软件项目经理,他带领3个开发组。工期紧,今天都在加班呢。为鼓舞士气,小张打算给每个组发一袋核桃(据传言能补脑)。他的要求是:
1. 各组的核桃数量必须相同
2. 各组内必须能平分核桃(当然是不能打碎的)
3. 尽量提供满足1,2条件的最小数量(节约闹革命嘛)


输入格式

输入包含三个正整数a, b, c,表示每个组正在加班的人数,用空格分开(a,b,c<30)


输出格式

输出一个正整数,表示每袋核桃的数量。


测试样例1

in: 
2 4 5

out:
20

测试样例2

in: 
3 1 1

out:
3

AC code:

import java.io.IOException;
import java.io.InputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {

    public static void main(String[] args) {
        InputReader in = new InputReader(System.in, " ");
        int a = in.nextInt(), b = in.nextInt(), c = in.nextInt(), i;
        for (i = max(a, b, c); i <= 21924; i++)
            if (i % a == 0 && i % b == 0 && i % c == 0) break;
        System.out.print(i);
    }

    static int max(int a, int b) { return a > b? a: b; }

    static int max(int a, int b, int c) {  return max(a, max(b, c)); }

    static class InputReader {

        BufferedReader read;
        StringTokenizer token;
        String delimiters;

        InputReader(InputStream in) { this(in, " \t\n\r\f"); }

        InputReader(InputStream in, String delimiters) {
            this.read = new BufferedReader(new InputStreamReader(in));
            this.token = new StringTokenizer("", this.delimiters = delimiters);
        }

        String next() {
            while (!token.hasMoreTokens())
                try {
                    this.token = new StringTokenizer(read.readLine(), delimiters);
                } catch (IOException e) {
                    e.printStackTrace();
                }
            return token.nextToken();
        }

        int nextInt() { return Integer.parseInt(next()); }
    }
}
import java.io.IOException;
import java.io.InputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {

    public static void main(String[] args) {
        InputReader in = new InputReader(System.in, " ");
        System.out.print(lcm(in.nextInt(), lcm(in.nextInt(), in.nextInt())));
    }

    static int gcd(int a, int b) { return b == 0? a: gcd(b, a % b); }

    static int lcm(int a, int b) { return a * b / gcd(a, b); }

    static class InputReader { . . . }
}

先解出来,再想怎么操作

使用kali对局域网内的主机进行远程控制 输入命令:hydra -l administrator -P/usr/share/woerdlists/rockyou.txt 192.168.100.241 smb -V。账户(adminitrator)密码:123456 【一般账户都是我们知晓了,如果不知道账户进行破解那几乎不太可能,密码如果设置的特别复杂无规律也是特别难破解的】【-r:扫描整个网段 后面就是设置 192.168.241.100/24的网络地址段 为 192.168.241.0/24 0和/24之间不要空格】 阅读详情

相关推荐

PP-OCRv6 ONNX部署的官方和手搓方案

PP-OCRv6 基于全新设计的 PPLCNetV4 统一骨干网络,提供 tiny、small、medium 三档模型,分别面向端侧/IoT、移动端/桌面端、服务端场景。在内部多场景综合评估集上,PP-OCRv6_medium 相比 PP-OCRv5_server 识别精度提升 5.1%、检测精度提升 4.6%,同时 GPU 推理速度提升 2.37×;以仅 34.5M 参数的规模,精度超越 Qwen3-VL-235B、GPT-5.5 等大型视觉语言模型。

懒人的技术笔记 1999

Java实现 蓝桥杯 历届试题 核桃的数量

历届试题 核桃的数量 时间限制:1.0s 内存限制:256.0MB 问题描述 小张是软件项目经理,他带领3个开发组。工期...

5391

rk3566-11.0新增device分区

1.增加块设备 2.修改根目录节点权限 3.开机启动自动挂载 增加块设备 1.修改parameter.txt文件,新增块设备大小及命名 device/rockchip/rk356x/rk3566_r/parameter.txt FIRMWARE_VER: 11.0 MACHINE_MODEL: rk3566_r MACHINE_ID: 007 MANUFACTURER: rockchip MAGIC: 0x5041524B ATAG: 0x00200800 MACHINE

weixin_51115260的博客 3387

蓝桥杯 PREV-1 历届试题 核桃的数量

历届试题 核桃的数量 时间限制:1.0s 内存限制:256.0MB 问题描述 小张是软件项目经理,他带领3个开发组。工期紧,今天都在加班呢。为鼓舞士气,小张打算给每个组发一袋核桃(据传言能补脑)。他的要求是: 1. 各组的核桃数量必须相同 2. 各组内必须能平分核桃(当然是不能打碎的) 3. 尽量提供满足1,2条件的最小数量(节约闹革命嘛) 输入格式 输入包含三个正...

荔枝的FM 686

fMRI原始数据分割的笔记

好记性不如烂笔头_fMRI小白入门笔记

ZY_brain的博客 2904

Windows10下RTABMAP+T265实现三维建图

win10+rtabmap+t265扫描地形

Suxiang1997的博客 3496

蓝桥杯历届试题 PREV1 - 核桃的数量

历届试题 核桃的数量   时间限制:1.0s   内存限制:256.0MB     问题描述 小张是软件项目经理,他带领3个开发组。工期紧,今天都在加班呢。为鼓舞士气,小张打算给每个组发一袋核桃(据传言能补脑)。他的要求是: 1. 各组的核桃数量必须相同 2. 各组内必须能平分核桃(当然是不能打碎的) 3. 尽量提供满足1,2条件的最小数量(节约闹革命嘛) 输入格式 输入包含三个...

Love_Irelia97的博客 318

STM32L452与FPGA通信翻车?手把手教你关闭I2C时钟延展避坑(附OVR错误解决方案)

本文深入解析STM32L452与FPGA在I2C通信中因时钟延展功能导致的常见问题,提供关闭I2C时钟延展的详细配置方法(NOSTRETCH模式),并针对可能出现的OVR错误给出Combined模式解决方案。通过实战案例和波形分析,帮助工程师快速排查和解决嵌入式系统中的I2C兼容性问题。

e3f4g5的博客 220

蓝桥杯PREV-1 历届试题 核桃的数量

蓝桥杯PREV-1 历届试题 核桃的数量 问题描述   小张是软件项目经理,他带领3个开发组。工期紧,今天都在加班呢。为鼓舞士气,小张打算给每个组发一袋核桃(据传言能补脑)。他的要求是:   1. 各组的核桃数量必须相同   2. 各组内必须能平分核桃(当然是不能打碎的)   3. 尽量提供满足1,2条件的最小数量(节约闹革命嘛) 输入格式   输入包含三个正整数a, b, c,表示每个组正在加班...

qq_43541423的博客 396

MIKE 21 教程 2.9 初始条件(Initial Conditions),边界条件Boundary Conditions),解耦(Decoupling)

本节讲解初始条件与边界条件的设置。这两个模块如设置有误则极易出现模型崩溃。

Hello Word 4812

物流分拣YOLO实战:YOLO26 OBB+YOLOv8多尺度融合,不规则包裹分拣效率提升40%(附训练+部署代码)

在物流分拣的工业场景中,模型的检测精度、推理速度、部署友好性本次基于YOLO26 OBB+YOLOv8多尺度融合打造的物流分拣视觉检测方案,精准解决了工业场景中不规则包裹的旋转检测、多尺度包裹的漏检问题,最终实现分拣效率提升40%,检测准确率提升至95%以上,且模型在边缘设备上的推理帧率稳定35FPS+,完全适配物流分拣的工业落地需求。

专注于Python爬虫开发,分享爬虫技巧、项目实战与反爬经验,使用Scrapy、BeautifulSoup等工具,解决数据抓取难题。 887

历届试题_核桃的数量(Java)

历届试题 核桃的数量 资源限制 时间限制:1.0s 内存限制:256.0MB 问题描述 小张是软件项目经理,他带领3个开发组。工期紧,今天都在加班呢。为鼓舞士气,小张打算给每个组发一袋核桃(据传言能补脑)。他的要求是: 各组的核桃数量必须相同 各组内必须能平分核桃(当然是不能打碎的) 尽量提供满足1,2条件的最小数量(节约闹革命嘛) 输入格式 输入包含三个正整数a, b, c,...

qq_45731732的博客 246

用 SNC 和 SAP Single Sign-On Secure Login 把 SAP 登录这件小事,变成一件安全又不用输密码的事

在传统的 SAP 系统里,登录这件事看起来很朴素:用户打开 SAP GUI,输入一个 SAP 用户名,再输入一个 SAP 密码,点回车,进系统,开始干活。表面上没毛病,但从安全角度看,这种老办法问题很大。默认情况下,这些用户名和密码在网络上传输时是明文,也就是不加密传输。攻击者如果在公司网络里做监听,理论上可以直接截取到口令信息,这种风险对今天任何一家合规要求高、审计严格的企业来说,基本是不可接受的。(SAP Help Portal)SAP 给出的答案叫做 ,全称是 。SNC 做的事情可以概括成两类:一类是

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

蓝桥杯——核桃的数量——历届试题

核桃的数量题目代码 题目 问题描述 小张是软件项目经理,他带领3个开发组。工期紧,今天都在加班呢。为鼓舞士气,小张打算给每个组发一袋核桃(据传言能补脑)。他的要求是: 各组的核桃数量必须相同 各组内必须能平分核桃(当然是不能打碎的) 尽量提供满足1,2条件的最小数量(节约闹革命嘛) 输入格式 输入包含三个正整数a, b, c,表示每个组正在加班的人数,用空格分开(a,b,c<30) 输出格式 输出一个正整数,表示每袋核桃的数量。 样例输入1 2 4 5 样例输出1 20 代码 sor

老拆的博客 604

计算机控制技术及应用

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

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

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

蓝桥杯历届试题核桃的数量

蓝桥杯试题 历届试题 核桃的数量 资源限制 时间限制:1.0s 内存限制:256.0MB 问题描述 小张是软件项目经理,他带领3个开发组。工期紧,今天都在加班呢。为鼓舞士气,小张打算给每个组发一袋核桃(据传言能补脑)。他的要求是: 各组的核桃数量必须相同 各组内必须能平分核桃(当然是不能打碎的) 尽量提供满足1,2条件的最小数量(节约闹革命嘛) 输入格式 输入包含三个正整数a,...

qq_41228145的博客 333

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

上一篇: 算法训练 简单加法(基本型)
下一篇: 历届试题 打印十字图
肖有量
博客等级 码龄8年 2506粉丝 182原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值