F(X)
题目详情:
我们定义 F(x)是满足 x mod(a*b) == 0这样的a,b的组数。现在给你一个n,你需要求出 F(n)
输入格式:
多组数据,每组第一行有一个整数n, 0 < n <= 10^11。
输出格式:
每组输出一行,满足条件的(a,b)对数
答题说明:
输入样例
1
2
3
4
输出样例:
1
3
3
6
解释
第一组: (1,1)
第二组: (1,1) (1,2) (2, 1)
第三组: (1,1) (1,3) (3,1)
第四组: (1,1) (1,2) (1, 4) (2, 1) (2,2) (4,1)
import java.util.ArrayList; import java.util.HashMap; import java.util.Scanner; public class TestFive { public static Integer Test(long n) { if (n == 1) { return 1; } return PrintPrimeFactors(n) * 3; } public static Integer PrintPrimeFactors(long n) { Integer count0 = 0; HashMap<Integer, Integer> map = new HashMap<Integer, Integer>(); ArrayList<Integer> arrayList = new ArrayList<Integer>(); for (int i = 2; i <= n; i++) { while (n % i == 0) { if (!arrayList.contains(i)) { arrayList.add(i); } if (map.containsKey(i)) { Integer count = map.get(i); count++; map.remove(i); map.put(i, count); } else { map.put(i, 1); } n = n / i; } } for (int i = 0; i < map.size(); i++) { count0 = CombineArray(map.get(arrayList.get(i)), count0); } return count0; } public static Integer CombineArray(Integer m, Integer n) { return (m + n + m * n); } public static void main(String[] args) { Scanner cin = new Scanner(System.in); while (cin.hasNext()) { long n = cin.nextLong(); System.out.println(Test(n)); } cin.close(); } }
相关推荐
声艺SOUNDCRAFT EFX12_EFX8调音台使用手册
EFX Chromatic Aberration 是after effect 的骗色插件,可用在ae cc 2014
proe结构设计efx教程
与小程序原先的结构一致,只是在小程序基础上做了一些扩展
1166:求f(x,n) 时间限制: 1000 ms 内存限制: 65536 KB 提交数: 28850 通过数: 19003 【题目描述】 已知 http://ybt.ssoier.cn:8088/problem_show.php?pid=1166 计算x=4.2,n=10 以及x=2.5,n=15 时的f 的值。 ...
奥托尼克斯FXY系列计数器样本pdf,提供“奥托尼克斯FXY系列计数器样本”下载,资料主要介绍了FXY系列计数器的特点、规格参数、参数设置及使用等,可供选型及使用时参考。
资源来自pypi官网。 资源全名:fxy-0.2.0.tar.gz
pic32mz efx usb msd user kit
AFSA_fxy是用人工鱼群算法(artificial fish swarm algorithm)解决二元函数寻优问题。文件打开后运行AFSA_fxy.m文件即可得到结果,代码中有详细注释,方便修改。运行示例已经保存为图片附在压缩包中。
三菱FX-VPS-EFX2N-10GM,20GM编程软件_fx-vps编程软件下载,fx2n-10gm.zip
适用于TMS320F2802x、TMS320F2803x、TMS320F2805x、TMS320F2806x 等型号的SPI详细手册。里面有详细的配置和开发流程。使用的4级FIFO。由个人整理,翻译,方便开发SPI通讯。
TMS320F2833x TMS320F2833x TMS320F2833x
STM32可以有STM32CubeMX轻松移植THreadX,雅特力从AT43F435/437系列开始不能完全兼容STM32,用不了THreadX了。 本移植采用最新(截至2023年3月12号)的AT32F435/437固件库V2.1.2,THreadX版本V6.2.1;依照雅特力官方...
牛顿-拉夫逊法潮流计算 一、 基本原理 设有单变量非线性方程 f ( x) 0 (11 29) 求解此方程时,先给出解的近似值 (0) x ,它与真解的误差为 (0) ...f x x f x f x x f x x f x n 式中, (0) ( ) (0) ( ), , ( ) n f x
C8051f93x-c8051f92x 说明 其中包括 c8051f930系列
采用无网格方法(无单元方法)计算受均布载荷作用杆力学问题
编写函数fun计算下列分段函数的值: x^2+x+6 x且x≠-3 f(x)= x^2-5x+6 0≤x且x≠2及x≠3 x^2-x-1 其它
TMS320F28004x-技术手册.pdf
主要介绍和协助应用进行迁移,主要从F2803x和F2802x系列产品移植到新产品F28002x系列。主要涵盖两个器件不同功能的差异和相关软件包区别。