Codeforces Round 936 (Div. 2) C. Tree Cutting

EDA与机器学习融合:智能优化芯片设计流程的工程实践 机器学习作为数据驱动的核心技术,通过从历史数据中学习复杂模式,实现对系统行为的预测与优化。其原理在于构建模型,将输入特征映射到目标变量,从而揭示数据背后的内在规律。在工程领域,这项技术的核心价值在于能够将专家经验转化为可量化、可复用的智能模型,显著提升自动化水平与决策效率。电子设计自动化(EDA)是芯片设计的关键支撑,传统流程高度依赖人工试错,面临参数空间巨大、优化周期长等挑战。将机器学习应用于EDA,能够构建预测模型来预估设计性能(PPA),或通过代理模型加速设计空间探索,实现智能化的设计辅助与优化。本文 阅读详情

Tree Cutting

题目描述

You are given a tree with n n n vertices.

Your task is to find the maximum number x x x such that it is possible to remove exactly k k k edges from this tree in such a way that the size of each remaining connected component † ^{\dagger} † is at least x x x.

† ^{\dagger} † Two vertices v v v and u u u are in the same connected component if there exists a sequence of numbers t 1 , t 2 , … , t k t_1, t_2, \ldots, t_k t1​,t2​,…,tk​ of arbitrary length k k k, such that t 1 = v t_1 = v t1​=v, t k = u t_k = u tk​=u, and for each i i i from 1 1 1 to k − 1 k - 1 k−1, vertices t i t_i ti​ and t i + 1 t_{i+1} ti+1​ are connected by an edge.

输入描述

Each test consists of several sets of input data. The first line contains a single integer t t t ( 1 ≤ t ≤ 1 0 4 1 \le t \le 10^4 1≤t≤104) — the number of sets of input data. This is followed by a description of the sets of input data.

The first line of each set of input data contains two integers n n n and k k k ( 1 ≤ k < n ≤ 1 0 5 1 \le k < n \le 10^5 1≤k<n≤105) — the number of vertices in the tree and the number of edges to be removed.

Each of the next n − 1 n - 1 n−1 lines of each set of input data contains two integers v v v and u u u ( 1 ≤ v , u ≤ n 1 \le v, u \le n 1≤v,u≤n) — the next edge of the tree.

It is guaranteed that the sum of the values of n n n for all sets of input data does not exceed 1 0 5 10^5 105.

输出描述

For each set of input data, output a single line containing the maximum number x x x such that it is possible to remove exactly k k k edges from the tree in such a way that the size of each remaining connected component is at least x x x.

样例输入

6
5 1
1 2
1 3
3 4
3 5
2 1
1 2
6 1
1 2
2 3
3 4
4 5
5 6
3 1
1 2
1 3
8 2
1 2
1 3
2 4
2 5
3 6
3 7
3 8
6 2
1 2
2 3
1 4
4 5
5 6

样例输出

2
1
3
1
1
2

原题

CF——传送门

代码

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

const int maxn = 1e5 + 6;
vector<int> e[maxn]; // 存边

int n, k;

void add(int a, int b)
{
    e[a].push_back(b);
}

int cnt; // 剪边后每个剩余的连接部分的大小为至少为x时的连通块的最大数量
int dfs(int u, int fath, int target)
{
    int cur_num = 1; // 当前子树大小
    for (int i = 0; i < e[u].size(); i++)
    {
        int v = e[u][i];
        if (v != fath)
        {
            cur_num += dfs(v, u, target); // 递归,并记录当前子树剩余大小(部分块会在递归后被剪掉)
        }
    }
    if (cur_num >= target) // 贪心,一旦大小大于等于x即目标大小,则将其剪掉
    {
        cnt++;
        return 0; // 已经剪掉该子树,返回大小0
    }
    return cur_num;
}

bool check(int x)
{
    cnt = 0;
    dfs(1, 0, x);
    if (cnt >= k + 1) // 连通块的最大数量大于等于k+1时,才能满足剪k条边时每个剩余的连接部分的大小为至少为x
        return true;
    else
        return false;
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    int t;
    cin >> t;
    while (t--)
    {
        cin >> n >> k;
        for (int i = 1; i <= n; i++) // 清空上一次测试中的边
        {
            e[i].clear();
        }
        int v, u;
        for (int i = 1; i <= n - 1; i++) // 邻接表加边
        {
            cin >> v >> u;
            add(v, u);
            add(u, v);
        }
        // 二分查找满足条件的最大x
        int l = 0, r = n + 6;
        while (l < r)
        {
            int mid = (l + r + 1) / 2; // 这里要 l + r +1 要不然会死循环
            if (check(mid))            // check函数自己写
            {
                l = mid;
            }
            else
            {
                r = mid - 1; // [mid,r] 不满足条件, 所以要移到满足条件的一方, r = mid - 1
            }
        }
        // 最后的l,r是答案 因为 l == r
        cout << l << '\n';
    }

    return 0;
}
[SV]SystemVerilog学习笔记之struct & union SystemVerilog学习笔记(四) 一、结构体(struct) 1.1、结构体(struct) 结构体声明:结构体默认是变量,也可以声明为线网 var struct{ //通过var进行结构体变量声明 logic [31:0] a, b; logic [ 7:0] opcode; } Instruction_Word_var; wire struct{ //结构体线网声明,定义为线网类型时,结构体的所有成员必须... 阅读详情

相关推荐

面向多目标跟踪的数据关联方法研究综述

摘要:多目标跟踪技术在军事和民用领域具有广泛应用,其核心挑战在于数据关联问题。本文系统梳理了数据关联的主要解决方法,首次将经典算法分为确定性关联和概率性关联两大类。确定性关联(如NNDA、GNN、MHT)采用"硬分配"策略,计算效率高但易受噪声干扰;概率性关联(如PDA、JPDA、PMHT)通过"软分配"处理不确定性,更适合复杂场景。文章详细分析了各类算法的原理、适用条件和优缺点,并探讨了智能学习等新兴技术在视觉跟踪等领域的应用。研究指出,尽管随机集滤波等新方法出现,

qq_43416206的博客 1141

Tree Cutting Codeforces Round 936 (Div. 2) 1946C

那么很容易想到的就是进行dfs,后序维护当前点u的子树大小siz[u],如果siz[u]>=x,那么这个点和它父节点之间的边就要断掉,使用的边的数量tot+1,然后令siz[u]=0,使其不影响后序的dfs过程,但如果当前点时根节点也就是1号点,它没有父节点,所以tot不能+1,而且如果以1为根的子树的大小=x。那么接下来考虑在确定了某个x的情况下求需要移除的最少边数,因为按照上面的单调性,移除的边数越少x越大。

ashbringer233的博客 435

卷积码和Turbo码

通信原理相关博文目录:目录我们常在移动通信中遇到的卷积码就是一种非分组码,卷积码和信号处理中的卷积运算有关系吗?是不是就是信号处理中的卷积运算,先看看编码器的编码原理再说:下面是一个比较实用的卷积码编码器:它有三个移位寄存器D0,D1,D2和三个模2加法器,以及一个旋转开关组成,编码前,先将各级移位寄存器清零:现在假设输入的信息码元是1101:当输入的第一个码元为1时,三个模2加法器计算的结果都为...

Reborn Lee 2万+

Codeforces Round 936 (Div. 2)------>C. Tree Cutting

二分答案+dfs

qq_75103498的博客 719

SpringBoot 中 @RequestMapping 及衍生注解的全面解析与实践

本文全面解析Spring Boot中@RequestMapping及其衍生注解的使用,涵盖核心功能、HTTP方法特定注解(@GetMapping/@PostMapping等)、属性详解(路径/参数/头信息等)以及路径变量处理。文章详细介绍了注解的组合使用、继承特性、版本控制策略等高级应用,并针对405/404等常见错误提供解决方案。通过学习这些注解的规范用法,开发者能够构建符合RESTful风格的API接口,提升代码可读性和可维护性。建议优先使用HTTP方法特定注解,合理规划URL结构,并注意避免路径冲突。

Java&AI小吕布的博客 2037

LM358实战:手把手教你搭建电流检测电路(附电阻选型计算)

本文详细解析了使用LM358运算放大器搭建电流检测电路的全过程,包括基础原理、采样电阻选型、放大电路设计及PCB布局技巧。通过实战案例和精确计算,帮助工程师快速掌握低成本、高精度的电流检测方案,适用于电源管理、电机控制等多种应用场景。

weixin_30872157的博客 449

codeforces round936——C(Tree Cutting)

这个题目,很容易就能想到二分子树的长度,难的是check函数,对于二分的长度,我们需要dfs贪心的切割,如果子树长度达到mid就切断,cnt++,最后判断一下cnt是否大于m。题目大意:给你一个树和一个剪切点树k,你需要求出删除 k 条边后,每个子树的最大长度。

m0_74237658的博客 606

ASPICE(Automotive SPICE)流程落地,研发管理工具自研,如何从量化数据体现研发效率提升的

摘要: ASPICE流程显著提升研发效率,主要体现在质量、成本和时间三个维度。关键量化指标包括:缺陷率降低30%-60%,维护工作量减少28%,研发周期缩短10%-20%,需求变更率降低58%,代码评审效率提升300%。初期开发成本虽增加9%,但长期回报率高。核心方法包括缺陷预防前移、需求精准管理和流程标准化与自动化。建立量化度量体系需覆盖缺陷密度、需求稳定性、进度偏差等指标,并依托工具链支持数据收集。实施ASPICE是短期投入换取长期质量提升和成本优化的高效投资。

汽车软件开发 183

深挖C++:类和对象(中)

(先进后出)

xys_678的博客 246

2026年中科曙光嵌入式笔试试卷带答案

2026年中科曙光嵌入式笔试试卷涵盖数字电路、总线协议、时序分析、存储原理及硬件寄存器操作等核心知识点。单选题聚焦SPI/I2C差异、建立/保持时间、ADC作用等基础概念;多选题考察时序约束、非易失存储、BMC功能等综合应用;判断题强化对关键术语的理解;填空题考查基本术语记忆;简答题要求掌握SPI与I2C对比、时序违例后果及BMC管理机制。试题紧扣嵌入式系统开发实际,突出接口协议、时序设计与硬件交互能力,是嵌入式岗位选拔的重要依据。

Open 23

【全网首发】2026华为OD双机位C卷 机考真题题库含考点说明以及在线OJ (Java)

如果你收到的是双机位C卷考试通知,需要针对性地调整备考策略。自2025年11月19日起,华为OD机试已正式从双机位A卷切换至。复杂度明显提升,需要组合多个算法点。题面相对简单,直接考查编程基本功。考查问题分析、算法选择和优化能力。通常为1-2个核心算法点的应用。

算法大师! 169

C++移动构造函数详解

移动构造函数是C++11引入的一种特殊构造函数,用于从临时对象(右值)"窃取"资源来初始化新对象,而不是进行昂贵的深拷贝。char* data;public:// 移动构造函数:参数是右值引用 &&// 关键:把源对象的资源置空。

拒绝AI文,努力在AI时代写出感动人心的好文章 392

一分钟详解PCL中点云配准技术

原文首发于微信公众号「3D视觉工坊」: 一分钟详解PCL中点云配准技术 本文是对前两篇文章:点云配准(一 两两配准)以及3D点云(二 多福点云配准)的补充,希望可以在一定程度上帮助大家对点云配准理解地更为深刻。 一 PCL中点云配准技术的简单实现 在同一文件夹下,有测试数据文件monkey.ply,该文件是利用Blender创建的默认Monkey模型。 利用如下代码,将初始点云(图中绿色点云)...

3D视觉工坊 3704

ThunderKittens 深度解析:一个不基于 MLIR 的 C++ 模板 GPU DSL

Triton 是"让更多人能写 GPU kernel",ThunderKittens 是"让会写的人写得更爽"。前者用 MLIR 换易用性,后者用 C++ 模板换可控性。它们不是替代关系,而是覆盖了 GPU 编程光谱的两端。ThunderKittens 的出现,本质上是对"GPU DSL 必须基于 MLIR"这一默认假设的挑战。编译期类型系统本身就可以是一个强大的 DSL 基础设施,不需要中间 IR,不需要黑盒 pass,也能实现 tile 级抽象和零运行时开销。

Maxwell_Newton的博客 343

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

VC中sqlite的使用

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

跟我学c++中级篇—类型定义的方式

本文系统阐述了编程中类型定义的重要性及c++中的实现方式。重点对比了宏定义、typedef与modern using三种机制,指出using在可读性、灵活性和模板支持上的优势,推荐优先使用。同时提醒开发者注意别名滥用、类型歧义、错误信息冗长等问题,强调统一规范与合理设计。最终结论:在现代c++开发中,应以using为主,兼顾简洁性与可维护性,避免陷入命名混乱与编译困境。

fpcc的专栏 82

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

【C语言】字符与字符串函数

C语言中字符串为以\0结尾的字符数组,标准库函数基于此约定。本文解析字符串内存布局,详解ctype.h与string.h中字符分类、长度计算、拷贝、比较等函数的使用要点,强调长度判断与越界风险,最后通过命令行待办事项示例整合fgets、sscanf、strncpy、strcmp,展示实际应用中的关键细节。

记录在学习过程中学到的知识 352

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

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

C++ 函数模版

模板参数:● template ,T 就是类型占位符,名字可以自定义,习惯用T● 占位符可以在函数返回值、形参、函数内部当作类型使用使用要点模板代码一般写在头文件:编译器需要看到完整模板源码,才能在每个编译单元完成实例化全局函数、类内成员函数都可以写成模板实例化发生在编译阶段,不是运行时隐式实例化:调用时编译器自动推导实参类型,生成对应版本函数。

2501_94041724的博客 305

C++ 运行时多态与虚函数机制全面剖析【面试重点】

构成C++ 运行时多态必须是基类的指针或者引用调用虚函数。被调用的函数必须是虚函数,并且派生类必须对该虚函数完成重写/覆盖(Override)。只有基类的指针或引用才能既指向基类对象,又指向派生类对象(切片机制);而只有完成了虚函数重写,派生类与基类才具备不同的函数行为,达到“指向谁就调用谁”的效果。在类成员函数的前面加上virtual关键字修饰,该成员函数就成为了虚函数。public:// 成员函数前加 virtual 修饰,声明为虚函数。

Fuyo_0209的博客 439

#SQLite 数据库笔记一:(概念 / 终端指令 / SQL 语句 / C 编程 / 回调函数)

数据库 = 数据的仓库,假设数据是海量。能力说明存储数据持久化保存,程序退出数据还在统计数据、分组、排序数据管理增、删、改、查(CRUD)嵌入式设备上也会用数据库(单片机网关、路由器、工业 HMI 都常见),因为 sqlite 体积小、无需服务进程、单文件即可。数据库 = 库 > 表 > 记录(行) > 字段(列)sqlite3 = 开源、C 写的、单文件、免安装、最多 2T 的嵌入式关系型数据库。

lwq20051110的博客 217

C 语言 malloc() 详解与实战 Demo

本文详解C语言malloc()函数,涵盖其语法、内存原理及实战应用。通过动态整数、数组、结构体与链表的Demo,演示如何安全申请、使用与释放内存,强调避免内存泄漏与空指针检查的重要性,帮助开发者掌握动态内存管理核心技能。

tangPHP的博客 374

蓝桥杯·全国青少年信息素养大赛·电子学会Python/C++考级 备考:莫队算法离线区间查询详解

备赛进行时:第十八届蓝桥杯软件赛报名已于 2026-10-08 10:00 开启、12-18 14:00 截止,省赛定在 2027-04-10(C/C++·Python 程序设计 9:00–13:00);中国电子学会 2026 年 12 月软件编程(C/C++ 一级至十级、Python 一级至六级)考级报名 9/23–12/2 16:00、统考 12-12;全国青少年信息素养大赛 2026—2027 赛季算法应用主题赛也已进入复盘练兵窗口。

IT_Scratch的博客 156

【C++ 基础入门】类和对象(上):封装、对象模型与 this 指针

C++类与对象知识(面向过程和面向对象的初步认识,类的初步认识,类的访问限定符及封装,类的作用域、实例化,类的对象模型,this指针)

2601_96587588的博客 887

【C++ 基础入门】C++继承(下):问题、底层原理与组合

C++继承(菱形继承的问题、虚继承原理、继承与组合、构造顺序)

2601_96587588的博客 795

C++09_vector类复习

本文以10个核心问题为主线,系统解析C++ vector的底层机制:从基本概念、初始化方式、遍历方法,到size与capacity的区别、扩容策略(VS 1.5×,g++ 2×)、reserve与resize差异、中间增删的挪动原理、迭代器失效原因,直至二维vector的内存布局(含三指针结构)。通过“先会用、再懂扩容、最后看清对象结构”的递进逻辑,揭示vector作为动态数组的本质——连续内存、自动扩容、随机访问高效,但插入删除代价高,迭代器易失效。全文深入浅出,助读者摆脱“黑盒”认知,真正掌握其内存图景

lemo_n_的博客 338

825 mW 顶上 212 °C:ASM491S 的 105 °C/W、250 mA 短路电流与热关断

25 °C 环境里结温 34.1 °C,125 °C 环境里结温 134.1 °C——后者已经离 150 °C 只有 16 °C 了,但还在范围内。换个角度看同一件事:从 25 °C 和从 125 °C 起算,温升都是 86.6 °C,但一个到 111.6 °C(还在范围内),一个到 211.6 °C(远远超限)。这个算例里 20 °C/W 是我假设的,实际值取决于机壳材料、密封程度、有没有风扇,跨度可以从 5 °C/W 到 50 °C/W 以上。外面 50 °C 的机箱,盒内就是 63.9 °C。

ANSILIC的博客 358

《C++ 项目:手写大模型接入 SDK》Gemini接口设计(上):初始化、全量响应实现和测试

本文系统完成了Gemini模型通过OpenAI兼容API的接入开发,基于Apifox验证接口规范,设计并实现GeminiProvider类,涵盖初始化、状态检测、全量响应等核心功能。重点处理了代理配置强制校验、Bearer鉴权、JSON序列化与响应解析等工程细节,并通过GTest与CMake完成单元测试,验证链路可用性。项目遵循策略模式,保持与DeepSeek、ChatGPT等模型的统一抽象接口,显著提升SDK可扩展性。

2501_91275995的博客 392
上一篇: AcWing 1644. 二叉树中的最低公共祖先 题解 线性dp 倍增算法 前序中序构造二叉树
下一篇: 二叉搜索树 题解 二叉搜索树的构建 DFS
bbc_ouo
博客等级 码龄3年 2096粉丝 132原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值