`
lilisalo
  • 浏览: 1106107 次
文章分类
社区版块
存档分类
最新评论

HDU/HDOJ 3988 2011 WHU多校联合 Harry Potter and the Hide Story

 
阅读更多

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
2
2 2
10 10
SampleOutput
Case 1: 1
Case 2: 2
Author
iSea@WHU

解题方法当然是把k质因数分解之后,分别判断每一个素因子在阶乘里面出现了多少次,然后取所有素因子出现次数的最小值即可

由于数据量比较大,我用的米勒罗宾素数测试进行的素因子分解。

我的代码:


分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics