Divisors 题目链接(点击) Your task in this problem is to determine the number of divisors of Cnk. Just for fun -- or do you need any special reason for such a useful computation? Input The input consists of several instances. Each instance consists of a sin…
A number whose only prime factors are 2,3,5 or 7 is called a humble number. The sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 24, 25, 27, ... shows the first 20 humble numbers. Now given a humble number, please write a program t…
Sumdiv Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 17387   Accepted: 4374 Description Consider two natural numbers A and B. Let S be the sum of all natural divisors of A^B. Determine S modulo 9901 (the rest of the division of S by 99…
Description Your task in this problem is to determine the number of divisors of Cnk. Just for fun -- or do you need any special reason for such a useful computation? Input The input consists of several instances. Each instance consists of a single li…
题意:给n和k,求组合C(n,k)的因子个数. 这道题,若一开始先预处理出C[i][j]的大小,再按普通方法枚举2~sqrt(C[i][j])来求解对应的因子个数,会TLE.所以得用别的方法. 在说方法前,先说一个n!的性质:n!的素因子分解中的素数p的个数为n/p+n/(p^2)+...+n/(p^k)+... <ACM-ICPC程序设计系列 数论及应用>上的方法,200+ms:首先先求解435以内的素因子.然后预处理出j!中每个素因子的个数,公式如下:num[j][i]=j/prime[i…
传送门 比赛的时候由于变量名打错了调了很久啊. 这道题显然是唯一分解定理的应用. 我们令P=a1p1∗a2p2∗...∗akpkP=a_1^{p_1}*a_2^{p_2}*...*a_k^{p_k}P=a1p1​​∗a2p2​​∗...∗akpk​​. 那么对于每一个质因子aia_iai​我们都可以计算出它在n!n!n!中出现bib_ibi​次,每次计算是O(logain)O(log_{a_i} n)O(logai​​n)的. 由于对于每个PPP每个aia_iai​会出现pip_ipi​次因此我…
---恢复内容开始--- We guessed some integer number xx. You are given a list of almost all its divisors. Almost all means that there are all divisors except 11and xx in the list. Your task is to find the minimum possible integer xx that can be the guessed nu…
题目链接 题意:输入两个整数L,U(L <= U <= 1000000000, u - l <= 10000),统计区间[L,U]的整数中哪一个的正约数最多,多个输出最小的那个 本来想着用欧拉函数,打个表求所有的约数个数,但是u太大,直接暴力求解 利用唯一分解定理,刷选出根号1000000000的素数,对l,u区间的每一个数进行分解 #include <iostream> #include <cstdio> #include <algorithm> #…
GCD and LCM Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 3409    Accepted Submission(s): 1503 Problem Description Given two positive integers G and L, could you tell me how many solutions of…
You are given an array aa consisting of nn integers. Your task is to say the number of such positive integers xx such that xx divides eachnumber from the array. In other words, you have to find the number of common divisors of all elements in the arr…