随笔分类 - 数论
欧拉函数(模板)
摘要:#include #include using namespace std;int oula(int n){ int ans=n; int i; for(i=2;i1) ans=ans/n*(n-1); return ans;}i...
阅读全文
高斯消元详解+模板
摘要:大佬讲解: https://blog.csdn.net/pengwill97/article/details/77200372 大佬模板: https://blog.csdn.net/pengwill97/article/details/77282328 ...
阅读全文
卡特兰数(Train Problem II )
摘要:Train Problem IIAs we all know the Train Problem I, the boss of the Ignatius Train Statio...
阅读全文
N的阶乘的长度 V2(斯特林近似)
摘要:输入N求N的阶乘的10进制表示的长度。例如6! = 720,长度为3。Input第1行:一个数T,表示后面用作输入测试的数的数量。(1 #include #include #include #include #include #define PI acos(-1)#d...
阅读全文
关于莫比乌斯和莫比乌斯反演
摘要:容斥原理 :点击打开链接莫比乌斯反演: https://blog.csdn.net/litble/article/details/72804050
阅读全文
几种数学公式(环排列 母函数 唯一分解定理 卡特兰数 默慈金数 贝尔数 那罗延数)
摘要:转自 https://blog.csdn.net/ZCY19990813/article/details/81181505一:环排列把一个m个元素的环在m个不同的位置拆开记得到m个不同的线排列。由于n个不同元素中任取m个元素的排列方法为P(n,m)种,所以n个不同...
阅读全文
Biorhythms(中国剩余定理)
摘要:中国剩余定理详解见博客:https://www.cnblogs.com/linyujun/p/5199415.html BiorhythmsSome people believe...
阅读全文
基础数论(逆元,费马小定理,扩展欧几里得,中国剩余定理)(模板)
摘要:整理自:https://www.cnblogs.com/linyujun/category/784324.html首先,引入同余定理:(a + b) % p = (a%p + b%p) %p (对)(a - b) % p = (a%p - b%p) %...
阅读全文
浙公网安备 33010602011771号