
数论——约数
Alex_McAvoy
想要成为渔夫的猎手
展开
-
数论 —— 约数
【唯一分解定理】对于任意一个大于 1 的正整数 n,都有且只有一种方式写出其素因子的乘积表达式。即:,其中,均为素数因此,当给出一个数 n 时,可以暴力枚举,以获取 n 的素因子map<int, int> num;//记录素因子个数int factor[N],cntF;//记录素因子void getFactor(int n){ cntF = 0; ...原创 2019-08-10 14:48:39 · 871 阅读 · 0 评论 -
Product of Three Numbers(CF-1294C)
Problem DescriptionYou are given one integer number n. Find three distinct integers a,b,c such that 2≤a,b,c and a⋅b⋅c=n or say that it is impossible to do it.If there are several answers, you can...原创 2020-01-24 16:20:37 · 733 阅读 · 0 评论 -
Mysterious Bacteria(LightOJ-1220)
Problem DescriptionDr. Mob has just discovered a Deathly Bacteria. He named it RC-01. RC-01 has a very strange reproduction system. RC-01 lives exactly x days. Now RC-01 produces exactly p new dead...原创 2019-01-21 22:15:37 · 485 阅读 · 0 评论 -
Factors of Factorial(AtCoder-2286)
Problem DescriptionYou are given an integer N. Find the number of the positive divisors of N!, modulo 109+7.Constraints1≤N≤103InputThe input is given from Standard Input in the following for...原创 2019-05-28 17:30:16 · 360 阅读 · 0 评论 -
Aladdin and the Flying Carpet(LightOJ-1341)
Problem DescriptionIt's said that Aladdin had to solve seven mysteries before getting the Magical Lamp which summons a powerful Genie. Here we are concerned about the first mystery.Aladdin was ab...原创 2019-03-18 21:34:52 · 296 阅读 · 0 评论 -
炫酷数字
【题目描述】小希希望你构造一个最小的正整数,使得其有n个因子。【输入描述】第一行一个整数T表示数据组数每组数据第一行输入一个正整数n,表示其因子数。n≤1,000,000T≤1,000,000【输出描述】输出一行一个整数,表示你构造出的这个数。注意:你需要保证你构造的数≤1,000,000,如果在这个范围里面无法构造出一个正整数满足条件,请输出-1。【样例】...原创 2019-03-14 19:38:25 · 418 阅读 · 0 评论 -
Sigma Function(LightOJ-1336)
Problem DescriptionSigma function is an interesting function in Number Theory. It is denoted by the Greek letter Sigma (σ). This function actually denotes the sum of all divisors of a number. For e...原创 2019-03-19 17:39:02 · 309 阅读 · 0 评论