
Luogu
我是一只计算鸡
The people who are crazy enough to think they can change the world are the ones who do.
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
【Luogu 4213】杜教筛
题目:求莫比乌斯函数、欧拉函数前缀和。 由于 n 为,所以用杜教筛。 莫比乌斯函数 欧拉函数 #include<bits/stdc++.h> using namespace std; const int maxn = 5e6 + 7; typedef long long ll; int p[maxn], flg[maxn]; ll mu[ma...原创 2019-08-28 11:04:42 · 177 阅读 · 0 评论 -
【Luogu 3807】Lucas定理
给定 n,m,p(p为素数),求 Lucas定理: #include<bits/stdc++.h> using namespace std; const int maxn = 1e5 + 7; typedef long long ll; ll fact[maxn], inv[maxn]; ll n, m, p; ll power(ll a, ll b, ll mod) ...原创 2019-08-28 16:25:09 · 201 阅读 · 0 评论 -
【Luogu 3868】TJOI 2009 中国剩余定理
两两互质 求解过程 一: 二: 1: 2:计算在模下的逆元 3:不要对取模 三: 证明: #include<bits/stdc++.h> using namespace std; typedef long long ll; ll a[17], b[17], n; ll ex...原创 2019-09-02 20:54:51 · 164 阅读 · 0 评论 -
【Luogu 4777】扩展中国剩余定理
假设已经求出前面个方程的通解 ,。 不难得出通解为 现在加入第个方程,等价于求解 通过扩展欧几里得求出方程的解,如果方程无解,则整个方程无解,如果有解 #include<bits/stdc++.h> using namespace std; const int maxn = 1e5 + 7; typedef long long ll; ll a[maxn], b[...原创 2019-09-02 20:57:16 · 177 阅读 · 0 评论