摘要:
NTT 首先发现操作的交换不影响答案 然后再打表,发现每项是一个组合数 然后NTT处理就行了 #include <bits/stdc++.h> using namespace std; typedef long long ll; const int maxn = 2e6 + 5, P = 99824 阅读全文
摘要:
最小生成树 容易想到按照边权合并 每次相当于计算当前联通块的方案数,依次合并即可 #include <bits/stdc++.h> using namespace std; const int maxn = 1e6 + 5, P = 1e9 + 7; struct data { int x, y, 阅读全文