矩阵乘法 二维 乘 二维 void mul(vector<vector<ll>>& c, vector<vector<ll>> a, vector<vector<ll>> b, int p) { int n = a.size(); for (int i = 0; i &…
取模模板类 #define LL long long template<const int T> struct ModInt { const static int mod = T; int x; ModInt(int x = 0) : x(x % mod) {} int val() { return x; } ModInt operat…
理论 模板 #define ll long long inline ll V2IDX(ll v, ll N, ll Ndr, ll nv) { return v >= Ndr ? (N/v - 1) : (nv - v); } ll primesum(ll N) { //求取1~N的所有质数和 ll *S; ll *V; ll r = (ll…