正文
增加 4 行删除 4 行
56 行未改动575859606162636465666768697012 行未改动838485868788899091929335 行未改动56 行未改动for (int k = n >> 1; (j ^= k) < k; k >>= 1);}for (int k = 1, m = 2; k < n; k <<= 1, m <<= 1) {int wn = power(3, (mod - 1) / m);for (int i = 0; i < n; i += m)for (int j = 0, w = 1; j < k; ++j, mul(w, wn)) {int tmp = Mul(a[i + j + k], w);a[i + j + k] = Sub(a[i + j], tmp);add(a[i + j], tmp);}}}void idft(int *a, int n) {std::reverse(a + 1, a + n), dft(a, n);12 行未改动for (int i = 0; i < len; ++i) c[i] = z[i];return c;}poly operator *= (poly &a, const poly &b) {return a = a * b;}poly operator *= (poly &a, const int &b) {for (auto &x : a) mul(x, b); return a;}poly operator * (poly a, const int &b) {return a *= b;}poly operator * (const int &b, poly a) {return a *= b;}poly _inv(const poly &a) {int len = a.size();if (len == 1) return {power(a[0], mod - 2)};poly b(_inv({a.begin(), a.begin() + len / 2})), c(a * b), ans(b);35 行未改动56 行未改动575859606162636465666768697012 行未改动838485868788899091929335 行未改动56 行未改动for (int k = n >> 1; (j ^= k) < k; k >>= 1);}for (int k = 1, m = 2; k < n; k <<= 1, m <<= 1) {int wn = power(3, (mod - 1) / m);for (int i = 0; i < n; i += m)for (int j = 0, w = 1; j < k; ++j, mul(w, wn)) {int tmp = Mul(a[i + j + k], w);a[i + j + k] = Sub(a[i + j], tmp);add(a[i + j], tmp);}}}void idft(int *a, int n) {std::reverse(a + 1, a + n), dft(a, n);12 行未改动for (int i = 0; i < len; ++i) c[i] = z[i];return c;}poly operator *= (poly &a, const poly &b) {return a = a * b;}poly operator *= (poly &a, const int &b) {for (auto &x : a) mul(x, b); return a;}poly operator * (poly a, const int &b) {return a *= b;}poly operator * (const int &b, poly a) {return a *= b;}poly _inv(const poly &a) {int len = a.size();if (len == 1) return {power(a[0], mod - 2)};poly b(_inv({a.begin(), a.begin() + len / 2})), c(a * b), ans(b);35 行未改动