hannibal_Iecter
hannibal_Iecter
全部文章
数学
ac自动机(7)
bitset(2)
BSGS(1)
dfs(3)
DP(19)
ODT(1)
splay(1)
ST表(2)
tarjan(2)
中途相遇法(1)
主席树(4)
二分图(1)
二叉树(1)
分块(1)
分治(3)
回文树(1)
多校(1)
字符串(1)
容斥(2)
平衡树(5)
并查集(1)
快速乘(1)
整体二分(1)
树链剖分(2)
模拟退火(2)
水题(1)
爬山算法(1)
矩阵快速幂(2)
线性基(1)
线段树(10)
编译器(2)
背包(2)
莫队(1)
计算几何(1)
随机数(1)
高精度(1)
归档
标签
去牛客网
登录
/
注册
hannibal_Iecter的博客
全部文章
/ 数学
(共9篇)
[模板]中国剩余定理
偷偷放个大佬的教学:中国剩余定理 互质的情况 ll crt(int n, int *a, int *m){ ll M = 1, d, y, x = 0; for(int i = 1; i <= n; i++) M*=m[i]; for(int i = 1; i <= n; i++...
2018-11-09
0
488
[欧拉函数][数论]GCD - Extreme (II) UVA - 11426
题目链接 题意: 求 <mstyle displaystyle="true" scriptlevel="0"> <munderover> ...
2018-11-07
0
456
[模板]欧拉函数
欧拉函数表(nlognlogn) int euler[maxn]; void geteuler() { euler[1] = 1; for(int i = 2; i < maxn; i++) { if(!euler[i]) for(int j = i; j < maxn;...
2018-11-07
0
539
[数论]GCD XOR UVA - 12716
题目链接 题意:在3e7的范围里有多少对gcd(a, b) = a^b。 思路:首先,我们需要知道一些前置知识. 1.a^ b = c.a^c = b; 2. a^b = c, gcd(a,b) = c, a = k * c, b = k * c; 我们可以得到gcd(a, a^c) = c。所以我...
2018-11-06
0
536
Gym - 101343A On The Way to Lucky Plaza
题目地址 题意:有m个商店,Alaa想买k个巧克力,每个商店只能买一块巧克力,Alaa进每个商店的概率是一样的,问你在买第k个巧克力的时候是在第n家店的概率是多少,然后答案化成分数取模的形式。 其实挺简单的,就是坑有点。。。 我们可以知道要求的概率为 ...
2018-11-03
0
455
扩展gcd模板
ll exgcd(ll a, ll b, ll &x, ll &y){ ll d; if(b == 0) { x = 1;y = 0; return a; } ll x1, y1; d = exgcd(b, a%...
2018-11-03
0
392
[数论分块] [清华集训2012]模积和
题目地址 对于 <mstyle displaystyle="true" scriptlevel="0"> <munderover> ...
2018-10-30
0
424
[数论分块]Fear Factoring Gym - 101652P
题目地址 题意:定义F(x)为x的所有因子和,现在给你l,r,求 <mstyle displaystyle="true" scriptlevel="0"> <munderove...
2018-10-30
0
461
组合数模板
1,当n,m较小,mod比较大的时候。 ll inv[maxn],fac[maxn]; void init() { fac[0] = 1; for(ll i = 1; i < maxn; i++) fac[i] = fac[i-1]*i%mod; inv[maxn-1] = power...
2018-10-10
0
475