![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Math Theory
文章平均质量分 60
sstrawberry
这个作者很懒,什么都没留下…
展开
-
zoj 3758 Singles' Day
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=5203 题目大意:给定进制b和1的个数n,求转为10进制后是不是素数。 题目分析:进制转化+Miller-Rabin随机性素数测试算法。 Miller-Rabin随机性素数测试算法: 定理:若p是素数,x是小于p的正整数,x^2 mod p = 1,原创 2014-03-04 12:01:02 · 934 阅读 · 0 评论 -
hdu 3501 Calculation 2
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3501 题目大意:求n的因子和。 题目分析:欧拉函数,小于n与n互质的数和n*phi[n]/2; 代码参考:#include typedef long long LL; const int MOD = 1000000007; LL Euler(LL n)//欧拉函数 { LL an原创 2014-03-04 13:12:39 · 816 阅读 · 0 评论 -
hdu 4336 Card Collector
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4336 题目大意:每包中含有这些卡片的概率为p1,p2,……pN. 每包至多一张卡片,可能没有卡片。问需要买多少包才能集齐N张卡片,求次数的期望。 题目分析:使用状态压缩表示卡片的收集情况,bin[i]=j表示在i状态的情况下,集齐卡片需要买东西次数的期望。 由于每包中有三种情况: 1. 没原创 2014-03-17 09:22:05 · 732 阅读 · 0 评论