摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3398很好的题目,考查数学思想!基本上是快速幕+ N!的快速质因数分解,看了他人的解题报告:我写的代码: 1 #include 2 #include 3 #include 4 const int max1=2000001; 5 int pri[max1]; 6 int b[max1]; 7 int ci[max1]; 8 int t=0; 9 void prime()10 {11 for (int i=4;i=pri[i];i++)59 while (kk%pri[...
阅读全文
摘要:Largest prime factorTime Limit: 5000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4916Accepted Submission(s): 1728Problem DescriptionEverybody knows any number can be combined by the prime number.Now, your task is telling me what position of the largest prime fa
阅读全文
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1391其实就是找规律的题目,但是我一眼没看到规律!于是按照自己的方法写!代码: 1 #include 2 #include 3 #include 4 using namespace std; 5 6 struct node{ 7 int x1,y1; 8 int num; 9 }a[20000];10 int cmp(node x,node y)11 {12 if (x.x1==y.x1) return x.y1<y.y1;13 return x.x1<y.x1;1...
阅读全文