gesp c++ 八级知识点

GESP C++ 各等级详细知识点汇总 函数声明与定义- 实参与形参,参数作用域- 参数传递方式:值传递、引用传递( 阅读详情

以下是根据GESP C++八级考试大纲的 超详细知识点解析与代码实现,涵盖计数原理、排列组合、图论算法、倍增法等核心内容,每个知识点均包含 概念说明、应用场景、使用方法、优缺点 及 完整代码示例。


一、计数原理

1.1 加法原理与乘法原理
  • 概念:
    • 加法原理:完成一件事有多个互斥方案,总方法数为各方案方法数之和。
    • 乘法原理:完成一件事需多个独立步骤,总方法数为各步骤方法数的乘积。
  • 应用场景:
    • 加法原理:选择不同类别的路径或物品。
    • 乘法原理:排列组合问题、密码组合计算。
  • 例题:
    • 加法:从北京到上海有3种飞机航班或2种高铁班次,总共有 3 + 2 = 5 种选择。
    • 乘法:密码锁有4位,每位有0-9可选,总组合数为 10^4 = 10000。
  • 代码示例(计算路径选择方案):
    int addPrinciple(int a, int b) {
         
          return a + b; }  // 加法原理
    int mulPrinciple(int steps, int options) {
         
                 // 乘法原理
        int total = 1;
        for (int i = 0; i < steps; i++) total *= options;
        return total;
    }
    

二、排列与组合

2.1 排列(Permutation)
  • 概念:从n个元素中选k个并考虑顺序,记作P(n, k)。
  • 公式:P(n, k) = n! / (n-k)!
  • 代码示例(生成全排列):
    #include <algorithm>
    #include <vector>
    using namespace std;
    
    vector<vector<int>> generatePermutations(vector<int> nums) {
         
         
        vector<vector<int>> res;
        sort(nums.begin(), nums.end());
        do {
         
         
            res.push_back(nums);
        } while (next_permutation(nums.begin(), nums.end()));
        return res;
    }
    // 调用示例:generatePermutations({1,2,3});
    
2.2 组合(Combination)
  • 概念:从n个元素中选k个不考虑顺序,记作C(n, k)。
  • 公式:C(n, k) = n! / (k! * (n-k)!)
  • 代码示例(生成所有组合):
    void backtrack(vector<int>& nums, int start, int k, vector<int>& path, vector<vector<int>>& res) {
         
         
        if (path.size() == k) {
         <
【2024 CCF编程能力等级认证(GESP)Python 】一级大纲 C++ & Python编程测试划分为一至八级,通过设定不同等级的考试目标,让学生具备计算机使用的基础能力和通过编程思维解决生活问题的能力,激发青少年编程相关知识与技术的兴趣,提高青少年编程科学技术素养,培养青少年编程综合实践能力,为广大学员在进。了解计算机语言的基本概念与转换,文件存储的类型与大小的概念,掌握编程文件创建、复制、粘贴、删除、移动、调试程序和保存的基本操作。掌握图形库turtle的主要绘图指令(前进、转弯、填色、抬笔等),使用turtle进行绘图。比较运算符:==、! 阅读详情

相关推荐

GESP考试大纲

一文搞懂计算机学会考级所有知识点

Sean肖恩带你,看看趣事!! 3678

【GESP C++八级考试考点详细解读】

【GESP C++八级考试考点详细解读】

王老师青少年编程 1987

GESP2024年3月认证C++八级真题解析

例如,1,2,3,1,4,2,3。小A写了一个N×M的矩阵A,我们看不到这个矩阵,但我们可以知道,其中第i行第j列的元素Ai,j是i和j的公倍数(i=1,...,N,j=1,...,M)。对于第二次询问,队列变化情况为:{}→ {1} → {1,2} → {1,2,2} → {1}→ {1,3} → {1,3,1}→ {}→ {3}。求的三角形周长,加上a和b。对于第一次询问,小杨同学会按照1,2,2的顺序放置卡牌,在放置最后一张卡牌时,两张点数为2的卡牌会被收走,因此最后队列中只剩余一张点数为1的卡牌。

lan_in的博客 2403

GESP八级通关秘籍(选择判断题)

【代码】GESP八级通关秘籍(选择判断题)

lan_in的博客 185

从零实现机械臂抓取仿真:用MoveIt+Gazebo完成物体pick&place全流程

本文详细介绍了如何使用ROS的MoveIt框架与Gazebo仿真环境,从零构建机械臂抓取仿真系统。涵盖环境搭建、MoveIt配置、Gazebo集成、抓取动作实现等全流程,帮助开发者掌握机械臂控制的核心技术,实现高效的pick&place任务。

weixin_29250403的博客 478

游戏经济数值模型的搭建过程——以标准卡牌游戏为例

一、总体规划 1.玩家分类 首先我们按照下表对玩家进行分类 付费能力即为充值额度;充值行为比如购买月卡/购买钻石;消费行为比如用钻石抽卡 在这里我们假设玩家是理性的,即玩家会以追求更高的性价比为目标进行充值与消费(即小R会优先买首冲+月卡,而不是买一个无用的无属性皮肤) 不同类型玩家之间的差异,实际上就主要由这些行为的差异而决定。 注:早期游戏制作的时候,活跃程度也是区分玩家类型的一个重要依据。不过目前现在游戏中有各种手段抹平了不同活跃玩家的差异(体力限制,活跃时间长的收益递减)..

dudu3332的博客 4232

手把手教你用IIO框架驱动ICM-42670陀螺仪(附完整SPI配置代码)

本文详细解析了如何在Linux系统中使用IIO框架为ICM-42670陀螺仪编写工业级传感器驱动。内容涵盖从SPI通信配置、IIO核心数据结构填充到数据采集与缓冲区管理的完整流程,并提供了实用的避坑指南与性能优化技巧,帮助开发者构建稳定高效的嵌入式传感器驱动。

f6g7h8i9j的博客 415

别再乱选WiFi信道了!手把手教你用WiFi Analyzer优化2.4G/5G家庭网络(附避坑指南)

本文详细介绍了如何使用WiFi Analyzer工具优化家庭WiFi网络,解决2.4GHz和5GHz信道的冲突问题。通过分析信道拥堵原因、提供安装使用指南及优化策略,帮助用户显著提升网络速度与稳定性,特别适合密集住宅区和多设备家庭。

weixin_42665725的博客 5897

本题要求你写个程序把给定的符号打印成沙漏的形状。例如给定17个“*”,要求按下列格式打印

本题要求你写个程序把给定的符号打印成沙漏的形状。例如给定17个“*”,要求按下列格式打印

ProceduralMan的博客 7414

别再盲调PID了!手把手教你用VOFA+实时可视化电机速度曲线(附STM32F4源码)

本文详细介绍了如何使用VOFA+工具实现PID参数的可视化调试,帮助开发者从盲调转向精准调优。通过实时可视化电机速度曲线,结合STM32F4源码示例,展示了如何高效调试Kp、Ki、Kd参数,解决响应慢、超调等常见问题,大幅提升电机控制系统的性能。

weixin_28366475的博客 130

航空机载总线网络概述

1.机载总线网络概述 现代战斗机的航空电子系统是航空电子技术经历了半个多世纪的漫长演变和不断进步的结果。航空电子系统结构的每次变化,其核心的机载总线网络技术也不断跨上新台阶,而且每次变革都能使飞机性能得到大幅提升。现代飞机的飞行与作战任务包括起飞、巡航、飞行控制、目标搜索、识别跟踪、火控计算、武器投射、制导、电子战、通信等,都需要航空电子系统承担,航空电子系统是现代战斗机的“大脑”和“神经中枢”,机载总线网络则是其关键的“神经网络”。在机载通讯领域发展过程中,具有代表性的典型总线有ARINC429、1553

qq_41854911的博客 1万+

【图像超分】论文复现:Pytorch实现SRCNN!保姆级复现教程!提供完整代码和最优权重模型(x2、x3、x4)!科研级论文曲线图!计算平均PSNR和SSIM!代码Windows和Linux都可用!

由于很多同学反应没用过jupyter notebook,更习惯用pycharm项目的形式跑代码。于是,本文将用pycharm项目的形式,重新复现SRCNN!【图像超分】论文复现:新手入门!Pytorch实现SRCNN,数据预处理、模型训练、测试、评估全流程详解,注释详细,简单修改就可以训练你自己的图像数据,有训练好的模型下载地址,随取随用。

主要更新底层视觉(去噪、超分等)相关的科研内容,形式为【论文精读】+【论文复现】 4712

Camera2Demo

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

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

jdk-8u144-linux-x64.tar.gz.

该资源为搭建Linux系统Java环境用,资源的后缀为tar.gz格式的压缩包

Outlook Express 6 (OE6) for Win7/Win8/Win10

英文版 Outlook Express6.0, 兼容Win7/Win10/WinXP,解压就可用。

上一篇: gesp c++ 七级知识点
下一篇: 信奥赛之c++基础(输入输出+计算机常识)
山中习静观潮槿
博客等级 码龄7年 297粉丝 42原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

山中习静观潮槿

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值
⌂ 换网址