摘要:
面对形如\(f_j \cdot g_{j-i}\)的“差卷积”,可以通过倒置数组的方法凑出卷积的形式 #include <bits/stdc++.h> #define int long long using namespace std; const signed mod=1004535809; in 阅读全文
摘要:
预处理质数表的质因数分解时间复杂度为\(O(\frac {\sqrt n}{\ln n})\) Pollard rho则用于在\(O(n^{1/4})\)的期望时间复杂度内计算合数\(n\)的某个非平凡因子 #include <bits/stdc++.h> #define int long long 阅读全文
摘要:
推理类问题,一定要注意排除法的应用,即推到最后剩下来的对象一定符合题意,不需要再付出代价去验证 如果由单个点构成的强连通分量满足把它删除后入度为0的强连通分量不增加,答案就可以+1 #include <bits/stdc++.h> #define int long long using namesp 阅读全文
摘要:
std::tie 可以用于结构化绑定 exgcd返回的\(x \in [-b,b]\),\(y \in [-a,a]\) #include <bits/stdc++.h> #define int long long using namespace std; typedef pair<int,int> 阅读全文
摘要:
A. Vadim's Collection #include <bits/stdc++.h> #define int long long using namespace std; int cnt[10]; signed main() { ios::sync_with_stdio(false); ci 阅读全文
摘要:
木柜子组乐队 #include <bits/stdc++.h> #define int long long using namespace std; signed main() { ios::sync_with_stdio(false); cin.tie(0); int T; cin>>T; whi 阅读全文
摘要:
小凯逛超市 #include <bits/stdc++.h> #define int long long using namespace std; const int mod=1000000007; int f[405][405]; signed main() { ios::sync_with_st 阅读全文