【JZOJ 5395】【NOIP2017提高A组模拟10.6】Count

jz集训 8.20 50 T1 旅游 Description ztxz16如愿成为码农之后,整天的生活除了写程序还是写程序,十分苦逼。终于有一天,他意识到自己的生活太过平淡,于是决定外出旅游丰富阅历。 ztxz16生活的城市有NM个景点,可以描述成一个NM的矩形,每个景点有一个坐标(x, y) (1 <= x <= N, 1 <= y <= M)以及美观度A[x][y]和观赏所需的时间B[x]... 阅读详情

Descrption

这里写图片描述

Solution

Ans=∑i=lrik

也就是求出 Ans=∑ni=1ik 即可,

这个Ans肯定可以表示成一个k+1的多项式,

——(以下为证明,大佬跳过)——-
设多项式 L(x)=∑ni=1ik ,
那么, L(x+1)=(x+1)k+L(x) ,
我们发现,只有当L为k+1的多项式时,才可以化简出一个 (x+1)k ,
——(好辣鸡的证明啊~)——

那么用拉格朗日插值法即可直接做,预处理前k+2个数,在最后的式子你会发现其只是一堆连续的数求积,直接预处理即可,

复杂度: O(m)

Code

#include <cstdio>
#define fo(i,a,b) for(int i=a;i<=b;i++)
using namespace std;
typedef long long LL;
const int N=1000010,mo=998244353;
int m,n,n1,M;
bool prz[N];
int pr[N/5];
int Ans[N];
LL ALLc,Pi[N];
LL ksm(LL q,int w)
{
    LL ans=1;
    for(;w;w>>=1,q=q*q%mo)if(w&1)ans=ans*q%mo;
    return ans;
}
LL LIP(int n)
{
    if(n<1)return 0;
    if(n<=m)return Ans[n];
    ALLc=1;
    fo(i,n-m,n-1)ALLc=ALLc*(LL)i%mo;
    LL ans=0;
    fo(i,1,m)
    {
        LL t1=Pi[i-1]*Pi[m-i]%mo*(LL)(n-i)%mo;
        if((m-i+2)&1)t1=-t1;
        ans=(ans+Ans[i]*ksm(t1,mo-2)%mo)%mo;
    }
    if(ans<0)ans+=mo;
    return ans*ALLc%mo;
}
int main()
{
    scanf("%d%d%d",&n,&n1,&m);
    M=m;m+=2;
    Ans[1]=Pi[0]=Pi[1]=1;
    fo(i,2,m)
    {
        if(!prz[i])pr[++pr[0]]=i,Ans[i]=ksm(i,M);
        fo(j,1,pr[0])
        {
            int t=pr[j]*i;
            if(t>m||t<1)break;
            prz[t]=1;
            Ans[t]=Ans[i]*(LL)Ans[pr[j]]%mo;
            if(i%pr[j]==0)break;
        }
        Pi[i]=Pi[i-1]*(LL)i%mo;
    }
    fo(i,2,m+2)Ans[i]=(Ans[i]+Ans[i-1])%mo;
    printf("%lld\n",((n<2?(n=2,ksm(2,M)):0)+LIP(n1)-LIP(n-1)+mo)%mo);
    return 0;
}
JZOJ5405. 【NOIP2017提高A组模拟10.10】Permutation Description你有一个长度为n 的排列P 与一个正整数K 你可以进行如下操作若干次使得排列的字典序尽量小 对于两个满足|i-j|>=K 且|Pi-Pj| = 1 的下标i 与j,交换Pi 与PjInput第一行包括两个正整数n 与K 第二行包括n 个正整数,第i 个正整数表示PiOutput输出一个新排列表示答案 输出共n 行,第i 行表示PiSample Input8 3 4 5 阅读详情

相关推荐

运算放大器测试方法-输入失调电压

由于运放输入回路的不对称性,在输入端将产生一定的误差信号,从而限制运放信号灵敏度。通常用输入失调电压(VOS)、输入失调电流(Ios)和输入偏置电流(IB)表示。运放有四个主要特征:输入失调特征、开环特征、共模特征及输出特征。其放大倍数较大,由于外界的影响,即使运放的输入端产生较小的输入信号,经过放大,在输出端也会产生较大的误差。为能精确测量其性能,一般采用辅助运放进行测试。下面着重讲了运放的主要参数及如何精确测量这些参数。文中DUT代表被测运放,A代表辅助运放。

weixin_46135931的博客 1万+

【NOIP2013模拟联考12】数数(数位dp||类欧几里得)

Description:ztxz16从小立志成为码农,因此一直对数的二进制表示很感兴趣。今天的数学课上,ztxz16学习了等差数列的相关知识。我们知道,一个等差数列可以用三个数A,B,N表示成如下形式:B + A, B + 2 * A, B + 3 * A, …, B + N * Aztxz16想知道对于一个给定的等差数列,把其中每一项用二进制表示后,一共有多少位是1,但他的智商太低无法算出此题,因

Cold_Chair的博客 1231

✨使用 vLLM + Docker 部署 Qwen3-Embedding-8B 并实现高效文本向量生成(附 `curl` 测试)

本文介绍了如何使用 vLLM 和 Docker 部署 Qwen3-Embedding-8B 嵌入模型服务,并通过标准 OpenAI 兼容接口进行调用和结果解析。如果你在部署中遇到任何问题,欢迎留言讨论!

用大模型重构生活:猫奴程序员的AI智能日常记录 6240

JZOJ 5396. 【NOIP2017提高A组模拟10.6】Blocks

JZOJ 5396. 【NOIP2017提高A组模拟10.6】Blocks DescriptionInputOutputSample Input10 5 1 7 9 9 5 9 3 4 5 8 主要思路:单调队列× 2 。 因为操作次数不限,因此若一段区间平均值超过 KK ,即为一组合法解。 将 AiA_i 减去 KK ,用 sumsum 记录前缀和,区间

Felix-Lee的博客 554

支付宝支付(三):周期扣款实现注意细节

一、周期扣款实现说明 1、官方文档入口:https://opendocs.alipay.com/open/20190319114403226822/intro 2、根据官方文档说明,周期扣款有两种方式:先签约后代扣场景和支付后签约场景 3、周期扣款接入问题文档: a>https://opendocs.alipay.com/support/01rg24 b>https://opensupport.alipay.com/support/knowledge/50249/20160248753

新鲜雾霾的博客 5702

MATLAB不能识别已安装的visual studio 2015解决方法

首先,对于MATLAB识别已经安装的vs版本通过命令: mex -setup 下图为本电脑下同时安装的两个visual studio 如果搞清楚MATLAB识别电脑上安装vs的过程,可通过命令: mex -setup -v MATLAB输出识别编译器的整个过程。其中HKLM和HKCU分别是注册表中的HKEY_CURRENT_USER,HKEY_LOCAL_MA…的缩写,MATLAB没有找到对应编译器是由于注册表里没有对应信息(主要是文件路径,C++编译器的路径),或者在注册表里存在该信息,但是找不到

qq_36320710的博客 4897

【数学】数列(jzoj 2752)

数列 jzoj 2752 题目大意: 给你一个正整数n(有多组数据),让你把它分为一个连续的正整数列之和(长度大于1),然你求着个数列最短的长度,如果这个序列不存在,那输出-1

ssllyf的博客 531

ROS应用之如何配置RTOS满足机器人系统中的实时要求

实时操作系统(RTOS)基本概念实时操作系统(RTOS)是设计用于实时应用的操作系统,其主要目标是在确定的时间内完成任务。RTOS的任务调度算法和优先级控制机制能够确保高优先级任务按时完成。精确的传感器数据采集:传感器数据需要在规定时间内采集并传输给控制系统。快速响应外部事件:对于控制系统,需要确保指令在最短的时间内得到响应。任务的调度周期:任务的周期可以通过公式计算,其中 ftask 是任务的调度频率。优先级分配。

weixin_68094467的博客 1008

(转载)类欧几里得(知识点整理+板子总结)

思路来源 https://blog.csdn.net/wwx233/article/details/82431820 https://www.cnblogs.com/cyz666/p/7083213.html https://blog.csdn.net/qq_35649707/article/details/79169099(证明清楚详细) https://blog.csdn.net/wh...

小衣同学的博客 2786

【YOLOs-CPP-图像分类部署】04-项目优化(加速部署)

本文详细介绍了将YOLO图像分类C++部署项目从CMake迁移到Visual Studio控制台应用的全过程。针对低配CPU性能瓶颈问题,作者通过替换多线程HPP代码为官方实现,并采用448x448固定输入尺寸优化推理速度。项目配置包含OpenCV和ONNX Runtime环境设置,实现了图像批量处理、分类结果显示及结果日志输出功能。关键步骤包括依赖库配置、DLL部署和代码调试,最终在Windows平台成功实现高效CPU推理。该方案显著提升了低配硬件的兼容性,为图像分类任务提供了稳定的部署解决方案。

深耕CV 354

Linux ARM平台开发系列讲解(LED) 2.1.1 如何点亮一个LED之添加设备树信息

1. 设备树添加设备信息 我拿到的开发板上有两颗LED供用户编程使用,分别是GPIO5_IO8和GPIO5_IO9,设备信息如下,不同板子的设备定义不同,根据自己的实际情况进行添加。 2. 编译设备树 根据自己拿到的SDK,执行编译命令,我这里拿到的SDK编译脚本为: ./build.sh kernel 3. 使用uuu工具烧录新编译好的内核 因为imx8 SDK设备树和内核是统一编译成一个镜像,所以只需要烧录内核,设备树文件也会烧录。 sudo uuu -b emmc imx-kernel.bin

DSMGUOGUO的博客 920

JZOJ 5395. 【NOIP2017提高A组模拟10.6】Count(拉格朗日插值)

JZOJ 5395. 【NOIP2017提高A组模拟10.6】Count 题目大意 令f(x)f(x)f(x)表示≤x\le x≤x的正整数中与xxx互质的数的平均数的两倍,求∑i=LRfk(i)\sum_{i=L}^{R}{f^k(i)}∑i=LR​fk(i)。 L,R≤108L,R\le 10^8L,R≤108,k≤106k\le 10^6k≤106. 题解 当x≤2x\le 2x≤2时,f(x)=xf(x)=xf(x)=x,因为一旦有r≤xr\le xr≤x与xxx互质,则一定也有x−r≤xx-

ZSJZ_liuzian的博客 250

基于DPCNN实现电商情感分析任务

下载链接项目中使用的模型是DPCNN,在模型中我们定义了三个组件,分别是embedding层,卷积层和全连接层。Embedding层:将每个词生成对应的嵌入向量,就是利用一个连续型向量来表示每个词卷积层:提取语句中的语义信息Linear层:将结果映射成2大小用于二分类,即正反面的概率。

优快云 精品推荐 1629

JZOJ 5395. 【NOIP2017提高A组模拟10.6】Count

JZOJ 5395. 【NOIP2017提高A组模拟10.6】Count DescriptionInput一行三个正整数 ,表示 ��,�,,含义如题所示。Output一行一个整数表示答案。Sample Input2 3 1Sample Output5Data ConstraintHint≤��的正整数中与��互质的数有��,平均数×��=�� ≤��的正整数中与��互质的数有��、��,平均数×��=��Solu

Felix-Lee的博客 985

win10 跳过U8环境检测的IE WebControls.rar

win10 安装u8的时候 提示IE WebControls 不通过,这个工具可以欺骗u8的检查。 跳过U8环境检测的IE WebControls。提示导入失败后,重新检测通过。

ssm框架搭建

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

[JZOJ5395]【NOIP2017提高A组模拟10.6】Count

Description 答案对998244353取模Solution有公式 ∑i=1ni[gcd(i,n)=1]=φ(n)∗n/2\sum\limits_{i=1}^{n} i[\gcd(i,n)=1]=φ(n)*n/2证明很简单 因为若gcd(i,j)=1,i<j\gcd(i,j)=1,i<j,一定有gcd(i,j−i)=1gcd(i,j-i)=1所以上面的式子显而易见。那么f(i)=i

Never give in. 455

NTscan扫描工具

ntscan是一个扫描器,可以扫描没有密码和弱密码的共享,先到配置文件中填写猜测的用户名和密码,扫描过程中右侧出现的是扫描日志。

【JZOJ 3492】【NOIP2013模拟联考12】数数(count)

Descriptionztxz16从小立志成为码农,因此一直对数的二进制表示很感兴趣。今天的数学课上,ztxz16学习了等差数列的相关知识。我们知道,一个等差数列可以用三个数A,B,N表示成如下形式:B + A, B + 2 * A, B + 3 * A, …, B + N * Aztxz16想知道对于一个给定的等差数列,把其中每一项用二进制表示后,一共有多少位是1,但他的智商太低无法算出此题,因此

1182

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

JZOJ 5405.【NOIP2017提高A组模拟10.10】Permutation

序列的逆数组转化,拓扑序列

Luckfort 401

【NOIP2017提高A组模拟10.10】Permutation

Description你有一个长度为n 的排列P 与一个正整数K 你可以进行如下操作若干次使得排列的字典序尽量小 对于两个满足|i-j|>=K 且|Pi-Pj| = 1 的下标i 与j,交换Pi 与PjInput第一行包括两个正整数n 与K 第二行包括n 个正整数,第i 个正整数表示PiOutput输出一个新排列表示答案 输出共n 行,第i 行表示PiSample Input8 3 4 5

Jacky35 696

今天立志成为黑马的一员

2013年9月13日,是我第一次在网上了解到北京黑马程序员。那一天的晚上我失眠了,兴奋地一晚没睡着。我意识到这必将是我人生最重要的一个转折点,所以,今天我想要要记录下这两天的所思所想,一来以后有所成就能够回忆起当时的心境,二来可以再往后的学习中,坚定自己的信念,不断鞭策不断提醒自己,我为什么会走上这条路,告诉自己,我的选择不是无缘无故的! 此时的我,是刚升入大四,周边同学都在忙着找实习,而我也在

梁剑的专栏 971

如何避免成为一个低级的码农?

计算机科学与技术专业的学生要怎样做才能避免成为 一个低级的码农? 知乎上计算机的似乎很多,大神也有不少,作为一个计算机科学与技术专业的学生,真心的请教一下要怎样做,要学什么,要怎样做,才能避免那种月工资两三千的码农甚至码奴的生活呢。 之前也有过类似的提问,但是本人看了一下那个问题下的答案,调侃者居多,希望大神们能够给小弟指一条不是那么荒唐的道路。。。 在知乎上看到上面这个问题...

因特马 1万+

[JZOJ5396]【NOIP2017提高A组模拟10.6】Blocks

Description Solution既然随便操作 问题可以转化成求极大的区间,区间平均数大于等于K可以每个点减掉K求前缀和。 从左向右扫描,应该考虑二分。 但是前缀和并不是单调的。然而显然可以对于前缀和再做一次前缀取min,正确性显然。复杂度NMlogNNMlog N 可能加上某些奇技淫巧优化可以通过。事实上前缀取min的过程,相当于取单调的过程对于左端点l1,l2l_1,l_2 如

Never give in. 436

立志!!!

我决定从今日起,开始写技术博客,提升技术,从点滴做起,加油骚年!!!

heijingtong的博客 284

把孩子打造成为码农

作者:Vamei 出处:http://www.cnblogs.com/vamei 欢迎转载,也请保留这段声明。   今天看到一个问卷调查,是问第一门学习的计算机语言是什么。本身想写QBasic,忽然想起曾经学习机时代的LOGO语言,以及看了很久的小乌龟。对啊,这才算是自己接触的第一门语言。 LOGO语言是为教育儿童编程开发的,所以语法很简单。它基于LISP,还附加有一个海龟绘图系统(Turt...

weixin_33831196的博客 190

NOIP2017提高A组模拟10.6】Biology

NOIP2017提高A组模拟10.6】Biology

chen1352 364

数位dp的一种姿势

最近跟RivendileRivendile大神学了一种新的姿势的数位dpdp,非常好用。 这种数位dpdp大致是这样的:f[i]...[2]f[i]...[2]表示的是i位的时候,中间是你需要保存的一些东西,最后的那一维11表示到第i位的时候前面的数都跟n的前面的位置的数相等,00表示小于(如果需要的话还可以记一下大于的)。 设计状态的时候就是需要什么就设什么,转移的过程中枚举所有的状态转移。

Vampire 883
上一篇: 【数论】拉格朗日插值法
下一篇: 【JZOJ 5400】【NOIP2017提高A组模拟10.7】Repulsed
HOWARLI
博客等级 码龄11年 109粉丝 378原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值