void Inv(int n, int *a, int *b) {
if (n == 1) { b[0] = fpow(a[0], mod - 2); return; }
Inv(n + 1 >> 1, a, b);
int x = 1, w = 0;
while (x < n << 1) x <<= 1, ++w; //为什么这里要到n<<1啊?
for (int i = 0; i < x; ++i) rev[i] = rev[i >> 1] >> 1 | (i & 1) << w - 1;
for (int i = 0; i < n; ++i) c[i] = a[i];
for (int i = n; i < x; ++i) c[i] = 0; //还有这里为什么要赋值成0?
ntt(x, b, 1);
ntt(x, c, 1);
for (int i = 0; i < x; ++i) b[i] = (2ll - 1ll * b[i] * c[i] % mod) * b[i] % mod;
ntt(x, b, -1);
for (int i = 0, inv = fpow(x, mod - 2); i < n; ++i) b[i] = 1ll * b[i] * inv % mod;
for (int i = n; i < x; ++i) b[i] = 0;
}
求教(瑟瑟发抖)