数论
半世blue
这个作者很懒,什么都没留下…
展开
-
群论
将置换写成循环循环置换的分解循环置换的阶循环置换分解为对换置换的奇偶性http://www.doc88.com/p-905280660599.html原创 2018-08-29 21:03:02 · 708 阅读 · 0 评论 -
hdu1817 Necklace of Beads(polya定理)
http://acm.hdu.edu.cn/showproblem.php?pid=1817Problem DescriptionBeads of red, blue or green colors are connected together into a circular necklace of n beads ( n InputThe input has sever原创 2018-01-25 11:22:21 · 235 阅读 · 0 评论 -
数论倒数-逆元
(a/b)%p=1,若存在一个a’使得(a*a’)%p=1,则a’就是a关于p的逆元,a与a’互为逆元(a与p互质) 求解逆元的方法有三种: 1.利用费马小定理 a^(p-1)=1(mod p),则a*a^(p-2)=1(mod p),所以a关于p的逆元就是a^(p-2),用快速幂求解LL power(int a,int n,int p){ LL ret = 1, res =转载 2017-07-29 20:54:29 · 870 阅读 · 0 评论 -
求组合数-费马小定理
//快速幂LL powermod(LL a,LL n){ if(a==0) return 1; LL ret=1,res=a; while(n) { if(n&1) ret=ret*res%mod; res=res*res%mod; n>>=1; } return ret;}LL fun(LL n原创 2017-07-02 19:18:46 · 602 阅读 · 0 评论 -
整数高精度算法
大整数高精度算法原创 2017-03-16 18:16:02 · 335 阅读 · 0 评论 -
卡特兰数
参见百度百科:https://baike.baidu.com/item/%E5%8D%A1%E7%89%B9%E5%85%B0%E6%95%B0 卡特兰数的前15项为:1,2,5,14,42,132,429,1430,4862,16796,58786,208012,742900,2674440,9694845 递推关系为:h(n)=h(n-1)*(4*n-2)/(n+1); 或者:h(n)=...原创 2018-03-18 10:54:13 · 117 阅读 · 0 评论 -
hdu 1724 Ellipse【自适应辛普森】
传送门:http://acm.hdu.edu.cn/showproblem.php?pid=1724Problem DescriptionMath is important!! Many students failed in 2+2’s mathematical test, so let’s AC this problem to mourn for our lost youth.. Lo...原创 2018-03-18 11:26:28 · 189 阅读 · 0 评论