[LeetCode 205,206][简单]同构字符串/反转链表

SMART200如何实现多次调用子程序带定时器功能 1、西门子200PLC的子程序由于很多限制条件,如果希望建立一个可以多次调用的子程序,那么这个子程序里是不能含有定时器指令的,所以我们只能退而求其次了。建议将沿指令(上升沿、下降沿)放在多次调用子程序的外面。 2、可以提供不同的时基,提供不同时间的定时 3、实现秒定时 5、子程序内部: STL代码: 1、时基信号由外部提供、 可以提供不同的时基信号 2、实现循环定时开关 LD #Start:L0.... 阅读详情

205.同构字符串
题目链接
只用比较每个字符上一次出现的位置是否一致

class Solution {
public:
    int mps[256],mpt[256];
    bool isIsomorphic(string s, string t) {
        memset(mps,-1,sizeof mps);
        memset(mpt,-1,sizeof mpt);
        for(int i = 0;i < s.size(); i++){
            if(mps[s[i] + 128]!=mpt[t[i] + 128])return false;
            mps[s[i] + 128] = mpt[t[i] + 128] = i;
        }
        return true;
    }
};

206.反转链表
题目链接

class Solution {
public:
    ListNode* reverseList(ListNode* head) {
        ListNode* pre = NULL;
        ListNode* nw = head;
        while(nw){
            ListNode* tmp = nw->next;
            nw->next = pre;
            pre = nw;
            nw = tmp;
        }
        return pre;
    }
};
SAP中关于预测需求的重要载体:计划独立需求 预测,就是为了调节客户需求的波动、不平衡,使企业的生产计划、物料计划尽量平稳、有序的必备工具。计划独立需求,Planned Independent Requirement(PIR)是SAP系统中最常见的预测需求。 阅读详情

相关推荐

从零开始理解二极管限幅:5种典型电路设计及实际应用场景解析

本文系统解析了二极管限幅电路的五大经典拓扑,包括串联与并联型上下限幅及双向限幅。通过剖析其核心原理与二极管的单向导电性、正向压降特性,结合ADC输入保护、电源管理、音频处理等实际应用场景,提供了从器件选型到设计陷阱规避的完整实战指南,帮助工程师为信号构建可靠的“安全笼”。

2y3u4i5o6p的博客 1034

[LeetCode 21,26,27][简单]合并两个有序链表/删除排序数组中的重复项/移除元素

21.合并两个有序链表 题目链接 直接比过去,把原来的链表拼起来,当然也可以拿值new过去。 /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }...

IDrandom的专栏 1638

Unity 升级引擎版本后构建报错:script class layout is incompatible between the editor and the player

Unity升级引擎版本后,项目报错:script class layout is incompatible between the editor and the player。

学习与分享 593

[LeetCode 299,303][简单]猜数字游戏/区域和检索 - 数组不可变

299.猜数字游戏 题目链接 class Solution { public: string getHint(string secret, string guess) { ios::sync_with_stdio(0); cin.tie(0); int a[10]={0},b[10]={0}; int acnt=0,bcnt=...

IDrandom的专栏 474

S32K344 Flash Driver实战:手把手教你实现任意字节写入与扇区解锁(含C40_Ip避坑指南)

本文深入解析S32K344微控制器的Flash驱动开发,重点解决C40_Ip驱动库的8字节对齐限制和扇区保护锁问题。通过实战案例和代码示例,详细介绍了如何实现任意字节写入、扇区解锁及性能优化策略,为Bootloader和OTA升级等应用提供可靠解决方案。

weixin_33713707的博客 432

立创开源:基于STM32F103与ADS1256的六维力传感器低成本实现方案

本文详细介绍了一种基于STM32F103微控制器与ADS1256高精度ADC的低成本六维力传感器实现方案。该方案通过3D打印的六梁弹性体结构结合应变片,将多维力信号转换为电信号,并由24位ADC进行高精度采集。文章涵盖了硬件选型、电路设计、嵌入式软件驱动及上位机数据可视化全流程,为机器人、精密测量等领域的爱好者提供了一个可复现的开源实践参考。

weixin_34718952的博客 392

[LeetCode 1365~1368][周赛]周赛178题解

5344.有多少小于当前数字的数字 题目链接 static const auto io_speed_up = [](){ ios::sync_with_stdio(false); cin.tie(0); return 0; }(); class Solution { public: vector<int> smallerNumbersThanCurren...

IDrandom的专栏 369

【AUTOSAR-COM】Transmission Mode 和 Transfer Property

1.COM模块的基本概念 首先在描述Transmission Mode 和 Transfer Property之前,有必要对COM模块的基本处理有一个直观的理解,我所描述的和对概念理解的也不一定完全正确。 Signal:指的是通信协议中的,一条报文中所保存的若干信号。 I-PDU:至少在COM模块中,可以理解为一条报文。 上图是在CANdb软件中编辑一个报文的Layout的界面,可以很形象的将I-PDU对等为这里的一条Message,而Signal就是需要在Message中需要摆放的Signal

tim_hoven的博客 4635

[LeetCode 14,20][简单]最长公共前缀/有效的括号

14.最长公共前缀 题目链接 class Solution { public: string longestCommonPrefix(vector<string>& strs) { if(strs.size()==0)return ""; int l= strs[0].length(); for(int i=1;i<...

IDrandom的专栏 368

深入解析ChangeFormer:基于Transformer的孪生网络在遥感变化检测中的创新应用

本文深入解析了ChangeFormer这一基于Transformer的孪生网络在遥感变化检测中的创新应用。通过分层Transformer编码器、特征差异计算模块和轻量级MLP解码器的设计,ChangeFormer在LEVIR-CD数据集上取得了90.4%的F1分数,显著优于传统卷积网络。文章还详细探讨了工程化实现、训练调参和模型部署的优化策略,为遥感变化检测领域提供了新的技术范式。

weixin_29051811的博客 732

QGis软件 —— 5、QGis增加线,并对线进行绘制、旋转、缩放、移动等基本操作

QGis软件 —— 5、QGis增加线,并对线进行绘制、旋转、缩放、移动等基本操作

8246

[LeetCode 1360~1363][周赛]周赛177题解

1360.日期之间隔几天 题目链接 static const auto io_speed_up = [](){ ios::sync_with_stdio(false); cin.tie(0); return 0; }(); class Solution { public: int nleap[13]={0, 31, 28, 31, 30, 31, 30, 31, 3...

IDrandom的专栏 353

LeRobot 机器人学习(Robot Learning)教程(二)经典机器人学

本文探讨了机器人学中基于学习的方法与传统动力学方法的对比与发展趋势。文章指出,传统方法依赖精确的动力学模型和大量人工调参,面临跨任务泛化能力弱、工程复杂度高、物理建模局限性等问题。随着机器学习技术的进步和机器人数据集的丰富,基于学习的方法展现出三大优势:(1)能够实现跨任务与实体的泛化;(2)降低对人类专业知识的依赖;(3)利用历史数据优化性能。文中以平面机械臂为例,分析了传统逆运动学方法的计算复杂性和环境适应性挑战,并指出基于学习的方案在处理高维感知输入、复杂接触动力学等方面具有明显优势。文章认为,结合物

2506_90492529的博客 1066

[LeetCode 1351~1354][周赛]周赛176题解

这场周赛还是有点意思的,没有那么水,大概hard有cf div2 D的感觉 1351. 统计有序矩阵中的负数 题目链接 第一种:二分 static const auto io_speed_up = [](){ ios::sync_with_stdio(false); cin.tie(0); return 0; }(); class Solution { public: ...

IDrandom的专栏 338

ssm框架搭建

这个是一个在idea上成功跑起来的ssm框架项目,保存在这里方便以后使用直接下载

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

[LeetCode 169,171][简单]多数元素/Excel表列序号

169.多数元素 题目链接 比较显然的做法是排个序后取中间元素和哈希表 看了下题解发现最后一个方法比较巧妙,叫做Boyer-Moore 投票算法,就是先把第一个元素设置为候选,然后循环过程中对候选+1,非候选 -1,到零后把下一个元素置为候选,最后的候选就是真值,简单证明下: 候选为真,则最多删掉同样数量的候选与非候选 候选为假 删掉更多的非候选,对结果无影响 删掉同样多的非候选与候选 真...

IDrandom的专栏 335

visio安装包

Microsoft Office Visio 是一款专业的制图软件。利用经过更新的形状、协作工具和数据链接图表,创建专业级图表以简化复杂的信息。

[LeetCode 190,191][简单]颠倒二进制位/位1的个数

190.颠倒二进制位 题目链接 贴一个纯位运算的版本和一个纯bitset的版本 class Solution { public: uint32_t reverseBits(uint32_t n) { bitset<32>a(n); string tmp = a.to_string(); reverse(tmp.begin(), t...

IDrandom的专栏 319

[LeetCode 404, 405][简单]左叶子之和/数字转换为十六进制数

404.左叶子之和 题目链接 static const auto io_speed_up =[](){ ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); return 0; }(); class Solution { public: int sumOfLeftLeaves(TreeNode* root...

IDrandom的专栏 311

[LeetCode 172,189][简单]阶乘后的零/旋转数组

172.阶乘后的零 题目链接 10 = 2 * 5,比n小是2的倍数的数肯定比是5的多,所以只需要看因子5出现的次数 class Solution { public: int trailingZeroes(int n) { int ans = 0; while(n){ n/=5; ans += n; ...

IDrandom的专栏 310

[LeetCode 198,202][简单]打家劫舍/快乐数

198.打家劫舍 题目链接 dp[n]=max(dp[n−1],dp[n−2]+w[n])dp[n] = max(dp[n-1],dp[n-2]+w[n])dp[n]=max(dp[n−1],dp[n−2]+w[n]) 可以滚动优化一下空间 class Solution { public: int rob(vector<int>& nums) { int...

IDrandom的专栏 309

[LeetCode 374,383][简单]猜数字大小/赎金信

374.猜数字大小 题目链接 static const auto io_speed_up = []() { ios::sync_with_stdio(0); cin.tie(0); return 0; }(); int guess(int num); class Solution { public: typedef long long LL; int gu...

IDrandom的专栏 302

[LeetCode 263,268][简单]丑数/缺失数字

263.丑数 题目链接 class Solution { public: bool isUgly(int num) { while(num&&(num&1)==0)num>>=1; while(num&&(num%3)==0)num/=3; while(num&&(num%5...

IDrandom的专栏 296

[LeetCode 326,342][简单]3的幂/4的幂

326.3的幂 题目链接 比较好想的是取对数法。 class Solution { public: double eps = 1e-11; bool isPowerOfThree(int n) { if(n<=0)return 0; double pw = log2(n) / log2(3.0); return fabs(rou...

IDrandom的专栏 288

[LeetCode 1356~1359][周赛]双周赛20题解

根据数字二进制下 1 的数目排序 题目链接 static const auto io_speed_up = [](){ ios::sync_with_stdio(false); cin.tie(0); return 0; }(); class Solution { public: int cnt[10010]; vector<int> sor...

IDrandom的专栏 286

LeetCode Hot 100 二叉树专题(二)3 题(Java)

本篇文章共 3 题:543. 二叉树的直径、102. 二叉树的层序遍历、108. 将有序数组转换为二叉搜索树。 每道题都统一按「① 题目分析 & 解题思路 → ② 常见解法(附代码)及讲解 → ③ 知识点总结」的顺序组织;代码使用 Java 编写,节点定义沿用 LeetCode 默认的 TreeNode。

2401_88612756的博客 368

LeetCode 每日一题 2026/11/2-2026/11/8

记录了初步解题思路 以及本地实现代码;并不一定为最优 也希望大家能一起探讨 一起进步

AlphaTao的博客 181

LeetCode 面试经典 150_多维动态规划_交错字符串(97_C++_中等)

LeetCode 面试经典 150_多维动态规划_交错字符串(97_C++_中等) 题目描述: 给定三个字符串 s1、s2、s3,请你帮忙验证 s3 是否是由 s1 和 s2 交错 组成的。 两个字符串 s 和 t 交错 的定义与过程如下,其中每个字符串都会被分割成若干 非空 子字符串: - s = s1 + s2 + ... + sn - t = t1 + t2 + ... + tm - |n - m| <= 1 - 交错 是 s1 + t

huayimenghan的博客 211

力扣73 矩阵置零

该解法通过标记含0的行和列来实现矩阵置零。遍历矩阵,用布尔数组记录有0的行和列;再遍历一次,若当前行或列被标记,则置为0。时间复杂度O(mn),空间复杂度O(m+n)。

Pniubi的博客 29
上一篇: [LeetCode 203,204][简单]移除链表元素/计数质数
下一篇: [LeetCode 217,219][简单]存在重复元素/存在重复元素II
IDrandom
博客等级 码龄12年 31粉丝 125原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值