Harry Potter and the Hide Story
Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 1Accepted Submission(s): 1
Problem Description
iSea is tired of writing the story of Harry Potter, so, lucky you, solving the following problem is enough.
Input
The first line contains a single integer T, indicating the number of test cases.
Each test case contains two integers, N and K.
Technical Specification
1. 1 <= T <= 500
2. 1 <= K <= 1 000 000 000 000 00
3. 1 <= N <= 1 000 000 000 000 000 000
Output
For each test case, output the case number first, then the answer, if the answer is bigger than 9 223 372 036 854 775 807, output “inf” (without quote).
SampleInput
SampleOutput
Author
iSea@WHU
解题方法当然是把k质因数分解之后,分别判断每一个素因子在阶乘里面出现了多少次,然后取所有素因子出现次数的最小值即可
由于数据量比较大,我用的米勒罗宾素数测试进行的素因子分解。
我的代码:
分享到:
相关推荐
收集的部分HDOJ杭电ACM题的代码 大牛勿下 全是基础供初级acmer使用
2017hdu多校联合训练第一场标程及数据
ACM/ICPC 2010年多校联合第十场第九题的解题报告及代码,AC代码有三个,最好的是src
HDU2013暑期多校联合训练第一场0723-解题报告和标程
这份压缩包内包含了2019年杭电多校第一场的数据与标程,欢迎下载
hdoj 2013 多校训练3标程+解题报告
2014 Multi-University Training Contest 1多校联合赛标程和部分数据。
自己积累的部分杭电oj的(hdu)解题代码。。大家有空来看看。 基本上是自己写的哈。有错误之处请指教、
杭电oj4405,一道简单的概率dp题目
杭电acm解题报告 详细解析2000-2099 适合acm初学者
ACM ICPC HDOJ1000
2019 Multi-University Training Contest 4(2019hdu多校第五场数据与标程),欢迎大家下载
HDOJ,2011阿里巴巴程序设计公开赛的标程 题目位置:http://acm.hdu.edu.cn/vip/2011alibaba/index.php
2019 Multi-University Training Contest 4(2019hdu多校第六场数据与标程)
杭州电子科技大学hdoj1002,大整数相加问题
The least common multiple (LCM) of a set of positive integers is the smallest positive integer which is divisible by all the numbers in the set. For example, the LCM of 5, 7 and 15 is 105. Input Input...
HDU2000至2099题的题目以及AC代码(含思路) 适合刚刚接触ACM的同学哦~ emmmm凑字
HDU的1250,主要是利用高精度加法,但是代码有点繁琐,效率不是很高
此乃2012多校联赛第五场的题目+数据+题解+标程
杭电ACMhdu1163