CF538div2-C-Trailing Loves (or L'oeufs?)-数论

Unity ProBuilder(自己创建斜面、拐角) ProBuilder基础实例 阅读详情

题目传送门
题意:
给你n<=1e18,k<=1e12,求n!(n的阶乘)转化为k进制后,有多少个后导0.
思路:
问题转化为求n%(k^r) == 0的r的最大值。
由于自己叙述太麻烦,就将官方题解贴出来。
The problem can be reduced to the following: finding the maximum r that n ! is divisible by br.

By prime factorization, we will have the following: b = p1y1·p2y2·…·pmym.

In a similar manner, we will also have: n ! = p1x1·p2x2·…·pmxm·Q (with Q being coprime to any pi presented above).

The process of finding p1, p2, …, pn, y1, y2, …, ym can be done by normal prime factorization of the value b.

The process of finding x1, x2, …, xm is a little bit more tricky since the integer they were originated (n !) is too huge to be factorized manually. Still the factorial properties gave us another approach: for each pi, we can do the following:

Initially, denote xi = 0.

Repeatedly do the following: add to xi, then divide n by pi. The loop ends when n is zero.

After all, we can obtain the final value r as of following: .

Total complexity: (as the number of prime factors of an integer b will not surpass ).

这个题解还好看懂,的那就是有一个地方有点难理解。如何处理n!,将n!表示成pi^xi中的xi求出来,其中我们只关注k分解出来的质因数,然后在此基础上处理n!,求出xi.边分解k边处理n!节约空间。
那么如何理解下面的代码可以求出xi是关键。
在这里插入图片描述
下面举个例子:
n = 125,i = 5;
首先将1-125之间可以整除5的数写出来,并标记每个数包含了几个5.
5(1) 10(1) 15(1) 20(1) 25(2) … 50(2) 75(2) … 95(1)…100(2) 125(3)
首先将c/i = 25;表示1-125之间有25个数包含了1个5,然后将c/=i;c = 25;然后c /5 = 5;表示有5个数包含了2个5,之后就是1个数包含了3个5(125)。
这个过程就像一层一层地求。如下:
5
5 5 5…5 5
5 5 5 5 5… 5 5 5… 5
那么第一列表示125。
求他的例子比如124也是一样的。

这个理解,问题就迎刃而解了。

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<set>
#include<stack>
#include<queue>
#include<map>
#include<cstring>
#include<string>
#include<cmath>

using namespace std;

typedef long long LL;

#define INF 0x3f3f3f3f
#define PI acos(-1.0)
#define pii pair<int,int>
#define all(x) x.begin(),x.end()
#define mem(a,b) memset(a,b,sizeof(a))
#define per(i,a,b) for(int i = a;i <= b;++i)
#define rep(i,a,b) for(int i = a;i >= b;--i)
const int maxn = 3e5;
LL n = 0,b = 0; 

int main(){

	//std::ios::sync_with_stdio(false);
	
	while(~scanf("%I64d %I64d",&n,&b)){
		LL ans = 1000000000000000000LL;
				
		//per(i,2,b){//变分解质因数,边处理,节约空间 
		for(LL i = 2;i <= b;++i){//变分解质因数,边处理,节约空间 
			if(1ll*i*i > b){//说明b是质数 
				i = b; 
			}
			int cnt = 0;
			while(b % i == 0){
				b /= i;
				++cnt;
			}
			if(cnt == 0){
				continue;
			}
			LL tmp = 0,mul = 1;
			/*
			while(mul <= n/i){//不是mul <= n是为了防止mul超过longlong 
				mul *= i; 
				tmp += (n/mul);
				
			}
			*/
			LL c = n;
			while(c > 0){//还不如这样直接 
				tmp += (c/i);
				c /= i;
			}
			ans = min(ans,tmp / cnt);
		}
		printf("%I64d\n",ans);
	}
	
	return 0;
}

YOLOv8交通监控全方案:精准车辆计数+违章(闯红灯/压线)识别,拿来就落地! 作为深耕计算机视觉落地的开发者,我见过太多交通监控的“伪智能”——传统系统要么车辆计数不准(漏计/重复计数),要么违章识别滞后(靠人工回看录像),甚至连“闯红灯、压线”这类常见违章都无法实时判定,完全满足不了实际交通管理需求。 阅读详情

相关推荐

战舰V3移植CANopenNode并驱动电机全流程

第三部分是电机的对象字典(也就是节点的OD)中的索引,长度2个字节。索引发送的是小段模式,比如这一部分为0X40 0X60,实际操作的索引地址为0X6040。第一部分是COB-ID,长度1个字节,电机的node-ID默认为0x01,所以报文ID一直是601。第五部分是要写入的数据,数据发送的时候是小端模式,低字节数据先发送,长度由第二部分决定。配置定时器6,时间为1ms,根据公式计算得到参数PSC取72-1,ARR取1000-1。第二部分是CMD,长度1个字节,其实就是数据部分的长度,

qq_50526837的博客 3049

Trailing Loves (or L'oeufs?)(唯一分解,尾零)

题目链接:http://codeforces.com/contest/1114/problem/C #include<cstdio> #include<map> #include<cstring> #include<algorithm> #include<cmath> #include<vector> using name...

永夜莫明的博客 285

Obsidian跨设备同步实战:阿里云OSS与Remotely Save插件配置指南

本文详细介绍了如何利用阿里云OSS对象存储与Remotely Save插件,为Obsidian笔记软件搭建一个低成本、高可靠性的私有化多端同步方案。从创建OSS Bucket、配置CORS规则、生成子账户密钥,到插件安装与多设备同步策略,提供了完整的实战配置指南,有效解决Obsidian用户的跨设备同步痛点。

qsc901234567的博客 1284

C. Trailing Loves (or L‘oeufs?)(求某个质因子在n的阶乘中的个数 + 思维)

dkb0,其中di是整数,且0≤di≤b−1。例如,第一个例子中的数字720可以表示为880(九进制),因为720=8⋅92+8⋅9+0⋅1。然而,Aki认为,一个数字拥有的尾随零的数量并不是固定的,而是取决于它所表示的基数(进制)。现在,由于他使用的数字变得相当奇怪,他请求你帮他计算这些数字的美丽度。给定两个整数n和b(以十进制表示),你的任务是计算n!(n的阶乘)在b进制(以b作为基数)表示下末尾零的个数。输入 输入仅包含一行,两个整数n和b(1≤n≤1018,2≤b≤1012)。

m0_64158084的博客 432

基于机器学习和辐射传输的地表温度模拟方法对比

对于不同的地表类型和不同的年份,经验方法是实用的,虽然整体精度不如物理方法,但具有计算速度快、对模型内部结构考虑较少等优点。尽管深度学习等回归的经验方法不需要考虑辐射传输和能量平衡的具体过程, 但在其输入参数的选择上也不能是无序和随机的,而是应选择有关相应物理过程的参数。经验方法在处理不同年份相同地表类型或表现相对较好, RMSE 约为 1.50K,但在不同地表类型且不同年份模拟结果较差, RMSE 约为 3.0K, 虽然精度不如物理方法,但它具有计算速度快,不需过多考虑模型内部结构的优点。

2301_77907355的博客 1023

8、 使用TPM密钥:从理论到实践的全面指南

本文全面介绍了如何使用TPM(可信平台模块)进行密钥管理,涵盖密钥的创建、存储、加载、迁移以及特殊密钥类型的使用。通过详细的操作步骤和代码示例,帮助读者掌握TPM密钥管理技术,确保系统的安全性和可靠性。

weixin_36212459的博客 243

CF Codeforces Round #538 (Div. 2) C - Trailing Loves (or L'oeufs?) /*质因数分解*/

CF Codeforces Round #538 (Div. 2) C - Trailing Loves (or L'oeufs?) /*质因数分解*/ 先筛出b中的质因数和各质因数个数,然后求出阶乘里对应的各质因数个数,求出n中各质因数个数/b中各因数个数的最小值即为答案。 自己写的代码又臭又长,还各种LL溢出(不过后面改好了)。 /* Name: Copyr...

Rshs 283

COMSOL有限元仿真深度指南:连接薄结构与实体结构(I)

COMSOL有限元仿真深度指南:如何在结构力学仿真中连接薄结构与实体结构?

忘了面孔的Batou 1万+

后导0

题目 这是一道很简单的中学数学题: 给定数n,求n!的p进制下有多少个后导零。非常简单。 为了简化问题,p保证为素数。 样例 输入 2 2 2 3 2 输出 1 1 #include <iostream> #include<cstdio> #include<cstring> using namespace std; const int Max = 1e6+7; int main() { int t,n,p; cin >> t; while(t--)

cosx_的博客 906

Simulink开发项1000例实战专栏--实例38:基于Simulink的周波变换器(Cycloconverter)

需求分析周波变换器(Cycloconverter),也称为频率变换器或直接变频器,是一种将输入的固定频率交流电直接转换为不同频率的交流电的电力电子设备。它广泛应用于工业领域,如大功率电机驱动、风力发电、船舶推进系统等场合。与传统的间接变频器(如交-直-交变频器)相比,周波变换器具有更高的效率和更简单的结构,适用于需要低频输出的应用场景。

xiaoheshang_123的博客 335

详解舵机的基本原理以及控制方法

文章目录什么是舵机?伺服控制硬件连接舵机规格SG90MG90SMG996R总结 什么是舵机? 舵机是伺服电机的一种,伺服电机就是带有反馈环节的电机,我们可以通过伺服电机进行精确的位置控制或者输出较高的扭矩; 舵机也叫也叫 RC 伺服器,通常用于机器人项目,也可以在遥控汽车,飞机等航模中找到它们。 类似舵机这样的伺服系统通常由小型电动机,电位计,嵌入式控制系统和变速箱组成。 电机输出轴的位置由内部电位计不断采样测量,并与微控制器(例如STM32,Arduino)设置的目标位置进行比较; 根据相应的偏差,控制

一名热爱技术的工程师的博客。分享技术干货,记录美好生活。永远相信美好的事情即将发生。 4万+

Codeforce 1114C. Trailing Loves (or L'oeufs?)

C. Trailing Loves (or L'oeufs?) http://codeforces.com/contest/1114/problem/C time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output The...

Wind_bow的博客 362

IEM模型,地表粗糙度模拟

利用微波反演土壤水分时候,利用IEM模型可以实现对随机地表的模拟

【CF#538div2:C】Trailing Loves (or L'oeufs?)(质因数分解+分析)

题目地址:https://codeforces.com/contest/1114/problem/C 题意 给出十进制的数n,和要转换的进制b,求n!转化成b进制之后末尾有多少个0 解题思路 就是求最大的k,使 对b质因子分解:,记录对应的个数(用map存对应关系,vector存) 对n!质因子分解:(后面的x1...xn在求结果的时候不用考虑) ans=min(),表示...

Cassie_zkq的博客 420

Statistics and Machine Learning Toolbox

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

数学建模模型总结

这是本人在两年内准备参加数学建模竞赛搜集到的模型资料,已经经过了本人的筛选和整理,希望能够对准备参加数学建模竞赛的学弟学妹们提供一些帮助!

Codeforces Round #538 (Div. 2) (CF1114)

Codeforces Round #538 (Div. 2) (CF1114)   今天昨天晚上的cf打的非常惨(仅代表淮中最低水平   先是一路缓慢地才A掉B,C,然后就开始杠D。于是写出了一个O(n^2)的线性dp,然后就wa6,调到结束。结束后发现完全看漏了两句话。噢,起始点!!!   好吧然后算算自己有可能这一场要变成+0,反正在0左右。 结束后开始然后开始写D,顺便思考F。结果写完D发现...

weixin_30532369的博客 149

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

C. Trailing Loves (or L'oeufs?) 数论---唯一分解定理的应用

先来看一道来自cf的题吧: 题意大概是 求 n! 转化为 b 进制下末尾有多少个 0. http://codeforces.com/contest/1114/problem/C C. Trailing Loves (or L'oeufs?) time limit per test 2 seconds memory limit per test 256 megabytes ...

ccsu_deer 676

C. Trailing Loves (or L'oeufs?)

http://codeforces.com/contest/1114/problem/C  题意:给(1≤n≤1e18, 2≤b≤1e12),求n!在b进制下末尾0的个数; 思路:&lt;=&gt; n!%(bi^k)==0下k的最大值,9在3进制下末尾0个数:9==3*3==100(3)两个0;而12==3*3+3==110(3)一个0; 再对n!素因子分解,求相约后最少0个数;   ...

newhonor 239

CF538H Summer Dichotomy

题意:可以录取x个学生,t<=x<=T。将学生分成两组,大小分别为n1,n2。一共有n个老师需要分进这两个组里,有m对老师互相讨厌不能同组,每个老师都对其所在组的大小有[li,ri]的限制。求一种学生和老师的合法分配方案。li,ri<=1e9,n,m<=1e5. 标程: 1 #include<bits/stdc++.h> 2 usi...

b121382291的博客 608

[CF538F]A Heap of Heaps

题目大意懒得写做法从0开始标号。 注意i是父亲是(i-1)/k 因此可以分块 对一段产生的影响可以在数组上打tag#include<cstdio> #include<algorithm> #define fo(i,a,b) for(i=a;i<=b;i++) #define fd(i,a,b) for(i=a;i>=b;i--) using namespace std; const int m

不来也不去的一只失忆蝴蝶 1419

求n!在m进制下末尾0的个数

参考: CF#538 C - Trailing Loves (or L'oeufs?) /// 分解质因数 n的阶乘在m进制下末尾有多少零 简单的讲解: 求n!在10进制下末尾0的个数,由于2*5=10,(2,5是质数)所以就是求n!里有几个min(2的个数,5的个数),由于2的个数远大于5的个数,所以我们只找有几个5就行了,比如计算25!的末尾0的个数,25!中包含5的有5,10,15,...

沉默的大多数 2169

Codeforces1114 C Trailing Loves (or L'oeufs?)

质因数分解

a free man 1371

(CodeForces) C. Trailing Loves (or L'oeufs?)

视频题解戳我 传送门 题目大意:求n!在b进制下末尾有多少个0. 解题思路:n!可以化成  ;k就代表了末尾0的个数,x不是b的倍数,即他的末尾不是0,每乘一个b相当于左移一位多一个0(就像2进制那样,都是一样的)。所以就是求n!总有多少个b,求出b的质因子,求出所有质因子在n!中的  个数/每一组b所需这个质因子个数  最少的那个( 质因子会重复,组成一个b可能需要多个相同的t ),那就是...

一只不争气的蒸汽机的博客 656

Trailing Loves (or L'oeufs?)

The number "zero" is called "love" (or "l'oeuf" to be precise, literally means "egg" in French), for example when denoting the zero score in a game of tennis. Aki is fond of numbers, especially those ...

black_hole6的博客 534

Codeforces - Trailing Loves (or L'oeufs?)

题目链接:Codeforces - Trailing Loves (or L’oeufs?) 其实就是求n的阶乘能整除多少次b。 考虑最少整除的次数:就是某个某个b的质因子的限制。 我们对b的每个质因子求min即可。 然后对于某个质因子,求解一下即可。 要注意a很大,如果i*a>n提前退出。不然会爆long long AC代码: #pragma GCC optimize("-Ofast"...

青烟绕指柔的博客 434

关于 n的p进制下有多少个后导零 的问题

给定数n,求n!的p进制下有多少个后导零。为了简化问题,p保证为素数。 如果用大整数写法,解法可能会超时。 易知,如果一个数可以另外一个数被整除,那么成为这个数的几倍数的数也可以被整除。 利用这个思路,可以推出“如果可以被p整除,那么这个数的几倍数的数也可以被整除”,即“如果可以使p进制下形成一个后导0,那么这个数的几倍数的数也可以如此,而且可能不止一个(与倍数成比例)” 代码如下: #include <iostream> #include <cstdio> #include &lt

CAOSHUCAOSHU的博客 2513

【Codeforces Round #538 (Div. 2) C. Trailing Loves (or L'oeufs?)】 分解质因数

C. Trailing Loves (or L’oeufs?) 题意 求n!n!n!在b进制下末尾有多少个000 1≤10≤1018,2≤b≤10121 \leq 10 \leq 10^{18},2 \leq b \leq 10^{12}1≤10≤1018,2≤b≤1012 做法 这道题我们首先考虑101010进制,那就是看n!n!n!能够整除555多少次和整除222多少次。取个minminmi...

lajiyuan的博客 257
上一篇: 发人深省的文章片段收录
下一篇: UVA140-Bandwidth(回溯法-双剪枝)
Mavis code
博客等级 码龄9年 13粉丝 147原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值