模数是998244353的话好像NTT可以更快. #include<bits/stdc++.h> using namespace std; typedef long long ll; const int MAXN = 3e5 + 51, MOD = 998244353, G = 3, INVG = 332748118; int exponent, fd, cnt = 1, limit = -1, rres, ptr; int rev[MAXN], f[MAXN], g[MAXN], tmp[M…