Xiao Ming's Hope HDU - 4349(Lucas定理)

CODESYS V3.5 SP17编程环境全攻略:从安装到多语言编程实战 本文全面解析CODESYS V3.5 SP17编程环境,从安装配置到多语言编程实战技巧。详细介绍了运行时环境设置、六种IEC 61131-3语言的特性对比与混合编程策略,以及高级功能开发如自定义算法模块和实时通信配置。适合工业自动化工程师快速掌握这一强大工具。 阅读详情
   

Xiao Ming's Hope

HDU - 4349
Xiao Ming likes counting numbers very much, especially he is fond of counting odd numbers. Maybe he thinks it is the best way to show he is alone without a girl friend. The day 2011.11.11 comes. Seeing classmates walking with their girl friends, he coundn't help running into his classroom, and then opened his maths book preparing to count odd numbers. He looked at his book, then he found a question "C (n,0)+C (n,1)+C (n,2)+...+C (n,n)=?". Of course, Xiao Ming knew the answer, but he didn't care about that , What he wanted to know was that how many odd numbers there were? Then he began to count odd numbers. When n is equal to 1, C (1,0)=C (1,1)=1, there are 2 odd numbers. When n is equal to 2, C (2,0)=C (2,2)=1, there are 2 odd numbers...... Suddenly, he found a girl was watching him counting odd numbers. In order to show his gifts on maths, he wrote several big numbers what n would be equal to, but he found it was impossible to finished his tasks, then he sent a piece of information to you, and wanted you a excellent programmer to help him, he really didn't want to let her down. Can you help him?

Input
Each line contains a integer n(1<=n<=10 8)
Output
A single line with the number of odd numbers of C (n,0),C (n,1),C (n,2)...C (n,n).
Sample Input
1
2
11
Sample Output
2
2
8
这道题需要使用卢卡斯定理,什么事卢卡斯定理呢 下面只是简单说一下什么事卢卡斯定理和代码实现,不做证明

首先,Lucas(卢卡斯)定理是什么?有什么用?

Lucas定理是用来求 C(n,m) mod p,p为素数的值。(注意:p一定是素数)

Lucas定理用来解决大组合数求模是很有用的。

For non-negative integers m and n and a prime p, the following congruence relation holds:

where

and

are the base  p  expansions of  m  and  n  respectively.
即变成位运算更简单点说C(A,B)≡C(a[n],b[n])*C(a[n-1],b[n-1])*C(a[n-2],b[n-2])*...C(a[0]*b[0])%p,数组里面存的是二进制位 递归方程:(C(n%p, m%p)*Lucas(n/p, m/p))%p。(递归出口为m==0,return 1)
实现:
    #include<bits/stdc++.h>  
    using namespace std;  
    typedef long long ll;  
    const int N =1e5;  
    ll n, m, p, fac[N];  
    void init()  
    {  
        int i;  
        fac[0] =1;  
        for(i =1; i <= p; i++)  
            fac[i] = fac[i-1]*i % p;  
    }  
    ll q_pow(ll a, ll b)  
    {  
        ll  ans =1;  
        while(b)  
        {  
            if(b &1)  ans = ans * a % p;  
            b>>=1;  
            a = a*a % p;     
        }  
        return  ans;  
    }  
      
    ll C(ll n, ll m)  
    {  
        if(m > n)  return 0;  
        return  fac[n]*q_pow(fac[m]*fac[n-m], p-2) % p;  
    }  
      
    ll Lucas(ll n, ll m )  
    {  
        if(m ==0)  return 1;  
        else return  (C(n%p, m%p)*Lucas(n/p, m/p))%p;  
    }  
      
    int main()  
    {  
        int t;  
        scanf("%d", &t);  
        while(t--)  
        {  
            scanf("%I64d%I64d%I64d", &n, &m, &p);  
            init();  
            printf("%I64d\n", Lucas(n, m));  
        }  
        return 0;  
    }  

下面是这道题的解释和代码: C(A,B)≡C(a[n],b[n])*C(a[n-1],b[n-1])*C(a[n-2],b[n-2])*...C(a[0]*b[0])%p。这里p是2。如果A为10010。B从0 -> 10010枚举。C(0,1)为0。如果n的二进制串中该位置为0,那么要让C(A,B)%2==1那么,只能让m的二进制对应位置为0,对于n的二进制中为1的位置,m的二进制对应位置为0或1的结果都是1。所以结果就是n的二进制中1的位置取2或1的所有可能。即2^k,k为n的二进制中1的个数。
code:
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
int main(){
    int n;
    while(~scanf("%d",&n)){
        int sum = 0;
        while(n){
            if(n&1){
                sum++;
            }
            n >>= 1;
        }
        printf("%d\n",(int)pow(2,sum));
    }
    return 0;
}








【HCIA学习记录】WLAN配置实验 HCIA-WLAN 阅读详情

相关推荐

LLM and Embedding区别

LLM(大语言模型)和 Embedding(嵌入)是自然语言处理(NLP)中的两个核心概念,它们的核心区别在于。Embedding 计算向量。

u010674101的专栏 1884

HDU4349-Xiao Ming's Hope(Lucas定理)

Xiao Ming's Hope Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 2435    Accepted Submission(s): 1674 Problem Description Xiao Ming

du_lun的博客 558

使用同一个时钟源clki,做两个二分频时钟,得到div2_clk1和div2_clk2,这两个时钟都能跟源时钟clki同步,但是div2_clk1和div2_clk2的相位可能是相同的,也可能是反相

比如,触发器1的初始Q为0,而触发器2的初始Q为1(这可能由于芯片制造工艺的微小差异、上电过程的随机性、或没有全局复位信号导致)。这句话的意思是:虽然div2_clk1和div2_clk2都是由同一个妈妈(clki)生出来的,频率也都是妈妈的一半,但它们“起步”的时刻可能不同。所以,上面那段话是在提醒你注意这种潜在的、由分频产生的时钟相位关系的不确定性,这在异步电路设计或时钟管理中是必须考虑的关键因素。结果:div2_clk1和div2_clk2的波形完全重合,它们的上升沿和下降沿都发生在同一时刻。

m0_49540263的博客 601

HDU 4349 Xiao Ming's Hope(Lucas定理、C[n][m]为奇数的个数)

题目链接: HDU 4349 Xiao Ming’s Hope 题意: 给定nn求Cmn(0≤m≤n,n≤108)为奇数的mC_{n}^{m}(0\leq m\leq n,n\leq 10^8)为奇数的m个数。 分析: 即Cmn %2=1的m个数C_{n}^{m}\ \%2=1的m个数,考虑将n和mn和m都表示成22的幂次组合形式,则任意的系数ni和min_i和m_i非0即1.因为C00=

ramay7 605

用示波器抓取同步Buck自举电容波形:从充电回路到SW节点振铃的完整分析

本文通过实测TI TPS54561和MPS MPQ4572同步Buck芯片,详细解析了自举电容在充电、维持和放电三个工作阶段的波形特征。重点揭示了电感泄放回路与充电回路重叠时,在SW节点引发的振铃现象及其产生机理,并提供了串联阻尼电阻等有效的工程抑制方法。文章结合示波器实测,为硬件工程师提供了从波形观测到问题调试的完整实践指南。

weixin_29276847的博客 378

交通流预测爬坑记(一):交通流数据集,原始数据

常用的交通流数据集,持续更新~~

K_first的博客 4万+

HDU4349 Xiao Ming's Hope Lucas定理

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4349 题目大意:找出杨辉三角第n+1行中有多少个奇数。 分析:n的范围比较大(10^8数量级),考虑到大组合数取模(找奇数,即对2取模)的问题,自然而然就想到Lucas了(关于Lucas定理:点击打开链接)。我们知道对于求C(n,m)mod p,Lucas定理是把组合数中的n和m换

AC_Gibson的专栏 647

Windows10下RTABMAP+T265实现三维建图

win10+rtabmap+t265扫描地形

Suxiang1997的博客 3497

hdu 4349 Xiao Ming's Hope(Lucas定理)

题意:求C(n,0),C(n,1),C(n,2)……C(n,n)中奇数的个数。 思路:Lucas定理的一个推论,把C(n,m)看做用二进制表示,那么为奇数的条件是n的每一位都大于等于m的对应位,因此答案是2^(n的二进制表示中1的个数)。 代码: #include #include #include #include #include #include #include #include #

绝望的乐园 829

android10 部分机型(华为)无法正常更新安装app

android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=file://storage/emulated/0/文件夹名/***.apk typ=application/vnd.android.package-archive }

森森先生的博客 3935

阿里云 Docker 镜像加速收费后:这些免费替代方案值得收藏

阿里云Docker镜像加速服务收费后,国内开发者急需免费替代方案。本文推荐2025年仍可用的7个免费镜像源,包括轩辕镜像、DaoCloud、网易云等,并提供多源配置方案以提高稳定性。建议开发者在CI/CD环境中配置多个镜像源,避免构建失败。文章还提供了详细的配置步骤和使用建议,适合个人和团队开发者参考。

sg_knight的专栏 1941

[HDU 4349] Xiao Ming's Hope (lucas定理)

HDU - 4349 给定n求满足 C(n,m)为奇数的 m的个数 首先朴素的想法是把每一个组合数都求出来 但是组合数比较大,所以自然的就想到 mod 2 所以很关键的一点是要转化为 C(n,m)%2 即 C(n,m)%2 = 1 的m的个数 利用lucas定理展开,审视乘积中的每一个组合数 由于 C(0,0) = C(1,0) = C(1,1) = 1,C(0,1) = 0 所以要

MisDeer's blog 301

Python爬虫教程:抓取短视频平台数据(以抖音和快手为例)

为什么抓取短视频平台数据?内容分析:通过抓取短视频平台上的视频内容、标题、标签等数据,可以进行内容分类、趋势分析、话题分析等。情感分析:抓取视频的评论数据,并进行情感分析,帮助企业或组织了解公众的情绪反馈。用户行为分析市场监测:通过抓取特定关键词或标签下的视频数据,分析市场趋势,进行竞争对手分析。短视频平台数据类型:视频信息:包括视频标题、描述、标签、作者等。用户信息:包括用户的昵称、粉丝数、关注数等。互动数据评论数据:视频下的用户评论内容及用户信息。

2201_76125261的博客 3674

hdu - 4349 - Xiao Ming's Hope - 大大的Lucas定理 && 小小的乘法逆元

首先给出这个Lucas定理: A、B是非负整数,p是质数。AB写成p进制:A=a[n]a[n-1]...a[0],B=b[n]b[n-1]...b[0]。 则组合数C(A,B)与C(a[n],b[n])*C(a[n-1],b[n-1])*...*C(a[0],b[0])  modp同余 即:Lucas(n,m,p)=c(n%p,m%p)*Lucas(n/p,m/p,p)

Julyana_Lin_夜 4690

ET2012新版免狗免安装绿色软件

ET2012新版免狗免安祖昂绿色软件。,新界面,新视觉,

pscad IEEE标准系统搭建说明

pscad IEEE标准系统搭建说明,包含典型的IEEE 9节点、14节点、30节点、39节点和118节点系统。内含标准测试系统的原始数据和潮流结果。

HDU - 4349 Xiao Ming's Hope lucas定理

题目:求c(n,0),c(n,1),...,c(n,n)中有多少个奇数 思路: C(n,m)%2,那么由lucas定理,我们可以写成二进制的形式观察, 比如 n=1001101,m是从000000到1001101的枚举,我们知道在该定理中 C(0,1)=0,因此如果n=1001101的0对应位置的m二进制位为1那么C(n,m) % 2==0,因此m对应n为0的 位置只能填0,而1的位置填

ACVevtor的博客 433

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

HDU 4349 Xiao Ming's Hope (Lucas定理详解+推理过程)

Problem Description \quadXiao Ming likes counting numbers very much, especially he is fond of counting odd numbers. Maybe he thinks it is the best way to show he is alone without a girl friend. The da...

邵光亮的博客 402

Camera2Demo

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

HDU 4349-Xiao Ming's Hope(Lucas定理的推广)

题目地址:HDU 4349 题意:求C(n,0),C(n,1),C(n,2)…C(n,n).当中有多少个奇数(1<=n<=10^8) 思路: 在这里首先给出一个判断组合数奇偶性的一个规律:如果(n&m)==m,那么C(n,m)为奇数,否则为偶数 咱这里涉及的数值太大,所以并不能用。 其实本题是Lucas定理推导题,我们分析一下 C(n,m)%2,那么由lucas定理,我们可以写成二进制的形

Rocky0429 988

HDU 4349 Xiao Ming's Hope(Lucas定理的推导)

Xiao Ming's Hope Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1294    Accepted Submission(s): 875 Problem Description Xiao Ming like

风尘_浪子 1524

hdu 4349 Xiao Ming's Hope (Lucas定理推导)

题意:求C(n,0),C(n,1),C(n,2)...C(n,n).奇数的个数 思路:我们分析C(n,m)%2,那么由Lucas定理可知,n和m可以写成二进制的形式,假设n=1001101,那么m是0~1001101,我们知道C(0,1)=0,因此如果n=1001101的0对应位置的m二进制位为1那么C(n,m) % 2==0,因此m对应n为0的位置只能填0,而1的位置填0,填...

155

hdu 4349 Xiao Ming's Hope,lucas定理

Xiao Ming's Hope Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1793    Accepted Submission(s): 1189 Problem Description Xiao Ming

G.D.Retop的专栏 647

hdu 4349 Xiao Ming's Hope (Lucas定理)

Xiao Ming's Hope Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 2160    Accepted Submission(s): 1469 Problem Description Xiao Ming lik

clover_hxy的博客 394

[HDU4349]Xiao Ming's Hope(组合数学Lucas定理)

题目描述传送门题解这题其实就是求∑i=0nCin%2\sum\limits_{i=0}^n C_n^i\%2 利用Lucas定理,每一次将n和i分解成两个二进制数,然后将它们的组合数乘起来 又因为C00=C01=C11=1,C10=0C_0^0=C_1^0=C_1^1=1,C_0^1=0 所以要想使总体为1,当n的二进制位为1时,有0/1两种选择,当n的二进制位为0时,只有0一种选择 所以如

zyf2000 455

HDU 4349 Xiao Ming's Hope (Lucas定理的应用)

HDU 4349 Xiao Ming's Hope (Lucas定理的应用)

Tc的专栏 856

HDU 4349——Xiao Ming's Hope——————【Lucas定理】

Xiao Ming's Hope Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1786Accepted Submission(s): 1182 Problem Description Xiao Ming likes cou...

weixin_30482383的博客 97

hdu 4349 Xiao Ming's Hope(Lucas定理)

http://acm.hdu.edu.cn/showproblem.php?pid=4349Lucas定理:A,B是非负整数,P是质数。A、B写成P进制 A=a[n]a[n-1]…a[0] B=b[n]b[n-1]…b[0] 则组合数C(A,B)与C(a[n],b[n])C(a[n-1],b[n-1])…*C(a[0],b[0])mod p同余 即:Lucas(n,m,p)=C(n%p,m%

HJ 434

【HDU】4349Xiao Ming's Hope-Lucas定理推导

                        Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)                                           Total Submission(s): 2618    Accepted Submissio...

红点雷龙XL 226
上一篇: 6-20 No Less Than X in BST(20 point(s))
下一篇: A + B for you again hdu1867(KMP的应用)
Guuuuuu老师儿
博客等级 码龄9年 259粉丝 718原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值