hdu 4055

安时积分法和开路电压法结合估算锂电池SOC 基于安时积分法和开路电压法结合的锂电池SOC估计Simulink仿真建模,利用安时积分法计算放电过程中的SOC,在搁置状态利用开路电压法进行SOC修正。 阅读详情

不错的dp

long long 果然比int慢好多

#include<cstdio>
#include<cstring>
#include<vector>
#include<cmath>
#include<algorithm>
#define N 1010
#define mod 1000000007
using namespace std;
typedef long long ll;
int sum[N][N];
char s[1010];
int main(){
    int i,j,n;
    while(scanf("%s",&s)==1){
        n=strlen(s)+1;
        memset(sum,0,sizeof(sum));
        sum[1][1]=1;
        for(i=2;i<=n;i++){
            for(j=1;j<=i;j++){
                if(s[i-2]=='I' || s[i-2]=='?')
                    sum[i][j]=sum[i-1][j-1];
                if(s[i-2]=='D' || s[i-2]=='?')
                    sum[i][j]=((sum[i][j]+sum[i-1][i-1]-sum[i-1][j-1])%mod+mod)%mod;
                sum[i][j]=(sum[i][j]+sum[i][j-1])%mod;
            }
        }
        printf("%d\n",sum[n][n]);
    }
}
可参考(http://blog.csdn.net/shiqi_614/article/details/7983298)


第十六章:载板制造工艺大全 本文详细介绍了IC载板制造的完整工艺流程,主要包括开料、钻孔、孔金属化、图形形成、层压、表面处理、成型和电测8大工序。每个工序都列出了关键参数和质量控制要点,如开料尺寸精度±0.1mm、激光钻孔孔径50-150μm、孔金属化铜厚20-30μm、图形形成线宽15μm±2μm等。文中还特别说明了MSAP工艺和沉金等特殊工艺的详细流程,以及成型精度和电测标准等关键指标。全文通过流程图和参数表格直观展示了IC载板制造的核心工艺和质量要求。 阅读详情

相关推荐

Ubuntu 22.04下Realtek R8125网卡驱动安装避坑指南(附DKMS自动编译配置)

本文详细介绍了在Ubuntu 22.04系统上为Realtek R8125 2.5GbE网卡安装驱动的完整流程与避坑指南。针对内核通用驱动r8169的冲突问题,重点讲解了如何通过DKMS(Dynamic Kernel Module Support)实现驱动的持久化自动编译与安装,确保系统内核升级后网卡驱动依然有效。内容包括环境准备、驱动源码获取、DKMS标准配置、驱动冲突解决(设置黑名单)以及日常维护与故障排查方法,旨在为用户提供一个一劳永逸的稳定解决方案。

echo99的专栏 1035

hdu 4055(dp)

题意:给出长度为n的字符串包含I、D、?,分别表示当前字符小于/大于/大于或小于下一个字符,这个字符串描述了1~1+n这写数字序列的排列增减情况,输出符合的序列有多少种。 题解:dp[i][j]表示取前i个字符最后一个数字也就是第i + 1个数字是j的所有可能序列种类,那么dp[i][j] = {s[i] == ‘I’ ? dp[i - 1][1] + dp[i - 1][2] + … + dp[

俯瞰风景 582

国产安全芯片在密码算法国密体系下的性能适配策略

国密体系即国家商用密码体系,是保障信息安全的核心技术体系。自20世纪90年代末起步,国密体系经历了从无到有、从弱到强的发展历程。1999年,国家密码管理局成立,标志着国密体系的正式建立。2000年,国密SM1算法首次发布,开启了国密算法的标准化进程。此后,SM2、SM3、SM4等算法陆续推出,形成了完整的对称与非对称密码算法体系。:2010年,国密标准正式纳入国家标准体系,国密算法在金融、政务、通信等关键领域的应用得到明确规范。

qq_40552871的博客 1371

HDU4055 (dp计数)

场上做不出难题见太少了。。真的是佩服这些人的脑洞啊。 我一定要记录下这两题,以后也可以看看,开了我的脑洞。 #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define I

yxmGo 405

基于STM32的双串口同时工作的详细指南(含完整代码示例)

STM32是STMicroelectronics(意法半导体)公司推出的一系列基于ARM Cortex-M内核的微控制器,广泛应用于嵌入式系统中。STM32系列微控制器具有高性能、低功耗和丰富的外设接口,适用于各种应用场景。USART(Universal Synchronous/Asynchronous Receiver/Transmitter)和UART(Universal Asynchronous Receiver/Transmitter)是串口通信的两种方式。

m0_57781768的博客 3811

别再只会用QTcpSocket了!手把手教你用QSslSocket为你的Qt网络应用加上SSL/TLS加密(附完整代码示例)

本文详细介绍了如何将Qt网络应用从QTcpSocket迁移到QSslSocket,实现SSL/TLS加密传输。通过对比API差异、解析核心机制和提供完整代码示例,帮助开发者快速掌握安全网络编程技巧,有效防范数据窃听和中间人攻击等安全风险。

weixin_30654583的博客 409

Number String HDU - 4055(计数dp)

题意: 给你一个字符串s,s[i] = 'D’表示排列中a[i] &amp;gt; a[i+1],s[i] = 'I’表示排列中a[i] &amp;lt; a[i+1]。 比如排列 {3, 1, 2, 7, 4, 6, 5} 表示为字符串 DIIDID 思路: 本来想着dp[i][j]用来统计第i个数为j时情况数量,但是好像不可行。参考了众多大神的博客,用dp[i][j]代表1-i的排列(!!!!注意是排列)其中...

日月 320

【复现论文】Looking here or there? Gaze Following in 360-Degree Images

论文:Looking here or there?

RichardoMu的博客 1141

hdu4055 Number String

DP、套路

ACoder 263

死磕GMSSL通信-java/Netty系列(二)

Netty-tcnative再linux编译比较好编译,但是再window编译,我尝试了各种办法,总是编译失败,所以我采用半自动的方式进行编译,Netty-tcnative会生成临时文件,直接用vs打开,设置openssl的头文件和静态库路径,然后生成静态库,静态库改个名字放到jar包里边,其实自动编译也是这个原理哈哈O(∩_∩)O。直接传输五个证书的路径吗,之前有的是说要转成x509之类的,转来转去的有点麻烦,这个是直接传输证书路径,由底层gmssl去解析,格式必须是pem格式。然而,若项目已依赖于。

qq_36577699的博客 3036

【异常】Python环境中没有安装 `openpyxl` 模块提示ModuleNotFoundError: No module named ‘openpyxl‘

是一个用于读写Excel 2010 xlsx/xlsm/xltx/xltm文件的库。只是示例版本号,你可以根据需要选择不同的版本。安装完成后,再次尝试运行你的程序,应该就不会再出现。,这表明你的Python环境中缺少。运行一个Python程序时遇到了。如果由于某些原因你无法直接使用。,你可以指定版本号来安装,这里。要解决这个问题,你需要安装。

奶爸的编程之路,也就一周冷个三天 3409

hdu 4055 Number String (基础dp)

Number String Time Limit: 10000/5000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1935Accepted Submission(s): 931 Problem Description The signature of a per...

weixin_30892763的博客 164

simulink的Sine Wave 模块详解

模块是 Simulink 中的一个信号源模块,用于生成正弦波信号。该模块可以根据设定的幅值、频率、相位和偏移量,在仿真过程中产生周期性的正弦波形。模块都能提供强有力的支持。通过深入了解其参数的影响及结合 MATLAB 脚本的应用,读者可以更加有效地利用这一模块进行仿真和研究。此外,通过实际应用场景的扩展以及常见问题解答部分的帮助,能够更好地掌握。模块是一个非常实用的工具,适用于需要生成正弦波信号的各种场景。模块的参数,可以进一步增强学习体验。模块参数的影响,下面我们将详细探讨每个参数如何影响仿真结果。

xiaoheshang_123的博客 1057

hdu4055

hdu4055 题意 给出一个长度为 n - 1 的字符串,要求构造一个包含数字 [1, n] 的排列,从第二位开始,'I' 表示当前位数字比前一位大,'D' 表示当前位数字比前一位小,'?' 表示可大可小。问有多少满足条件的 n 的排列。 分析 设 dp[i][j] 为 [1, i] 已排列好,最后一位为 j 的方案数。 如果 s[i] = 'I', \(dp[i][j] = \sum_{k=1...

weixin_34208185的博客 183

廖雪峰Python教程[完整版]

廖雪峰的python教程整理的,已经排好版了,而且还是完整的,适合小白

TMS_WebGMaps_1.9.8.0_Full_Source

TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder

HDU 4055 Number String

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4055 题意:给了一组字符串包含'?','I','D'。'I'代表当前字符比后一个字符大,'D'代表当前字符比后一个字符小,'?'则都可以。询问有多少个这样的排列(包含1-n+1,n为字符串的长度) 分析:递推。有两种情况 第一种是第i个为I(小于号,升序):dp[i][j] = dp[i-1][...

zhlbjtu2016的博客 302

Statistics and Machine Learning Toolbox

Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具

hdu 4055 && hdu 4489 动态规划

  hdu 4055:   一开始我想的递推方向想得很复杂,看了别人的博客后才醍醐灌顶:   参照他的思路和代码: 1 #include<cstdio> 2 #include<cstring> 3 #include<algorithm> 4 using namespace std; 5 const int mod =...

aidiao7379的博客 88

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

Number String HDU - 4055(留)

留

leekerian的博客 193

Hdu 4055 Number String

题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=4055 和前一题类似。 DP方程为: dp[i][j] 表示长度为i以j结尾的合法的排列个数(由1...i组成的排列)。 还要清楚一个结论: 给定一个长度为i-1的字符串,由{1,2,...,i}组成的合法排列数和由{1,2,...,j-1,j+1,...,i+1} 组成的合法排列数

768

HDU 4055 Number String:前缀和优化dp【增长趋势——处理重复选数】

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4055 题意:   给你一个由'I', 'D', '?'组成的字符串,长度为n,代表了一个1~n+1的排列中(数字不重复),相邻数字的增长趋势。('I'为增,'D'为减,'?'为未知)   问你符合条件的数列有多少种。 题解:   表示状态:     dp[i][j] = c...

a1392136的博客 501

hdu 4055 dp

http://acm.hdu.edu.cn/showproblem.php?pid=4055 #include #include #include #include #include #include using namespace std; const int mod=1000000007; const int sizen=1010; __int64 dp[sizen

u012342878的专栏 528

HDU 4055 - Number String

大意:给出一个排列的上升下降的情况,求满足条件的序列数。 例如:321 对应着 DD, ID对应着: 231、132。 DP问题,分析待整理,本题个人觉得挺经典的。 1 /* 2 ID:esxgx1 3 LANG:C++ 4 PROG:hdu4055 5 */ 6 #include <cstdio> 7 #include <cstri...

weixin_30463341的博客 113

hdu4055 dp

http://acm.hdu.edu.cn/showproblem.php?pid=4055 Problem Description The signature of a permutation is a string that is computed as follows: for each pair of consecutive elements of the perm...

weixin_34367845的博客 101

HDU 4055:Number String(DP计数)

http://acm.hdu.edu.cn/showproblem.php?pid=4055 题意:给一个仅包含‘I','D','?'的字符串,’I'表示前面的数字比后面的数字要小(Increase升序),'D'表示前面的数字比前面的数字要大(Decrease降序),'?'表示有可能是'I'也有可能是'D',长度为n的字符串就有n+1个数字,在这n+1个数字里面,问符合给出的字符串的条件的序列数...

weixin_30647065的博客 155

HDU-4055:Number String

链接:HDU-4055:Number String 题意:给你一个字符串s,s[i] = 'D'表示排列中a[i] > a[i+1],s[i] = 'I'表示排列中a[i] < a[i+1],s[i] = '?' 表示无限制。 题解:dp[i][j]表示前i个满足字符串条件的结尾为j的 i 的排列。 如果s[i - 1]是' I ',那么dp[i][j] = dp[i-1][1...

weixin_34413357的博客 157

hdu4055(dp)

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4055 题干描述:给定一个字符串,要求计算前N个自然数的符合字符串要求的排列数 思考: 首先这是一个dp题,N最大为1000所以可以开二维数组,然后定义f[i][j]为第i位为j的结果 问题是这里存在了当j为k时前面是否存在k这种情况并且如何排除,这是一个难点 思路是通过网上看别人的分析后理解

zb1030415419的博客 513

hdu 4055 Number String

Number String http://acm.hdu.edu.cn/showproblem.php?pid=4055 Time Limit: 10000/5000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others) Problem Description The signature of a permutation...

weixin_30390075的博客 73
上一篇: hdu 4119 && hdu 4082 && hdu 4054
下一篇: hdu 4057
Benzema67
博客等级 码龄15年 120粉丝 357原创
评论 3
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值
⌂ 换网址