正文
增加 5 行删除 49 行
2 行未改动345678910111259 行未改动7273747576777879808182838450 行未改动1351361371381391401411421431441451461471481491501511521531541551561571581591609 行未改动1701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012 行未改动2042052062072082092102112122132142152162172182192202212222232 行未改动```cpp#include<bits/stdc++.h>using namespace std;using ll=long long;using ull=unsigned long long;using lll=__int128;int main() {ios::sync_with_stdio(0);cin.tie(0),cout.tie(0);59 行未改动```cpp#include<bits/stdc++.h>using namespace std;using ll=long long;using ull=unsigned long long;using lll=__int128;const int MAXN=1<<18;int n;ll st[MAXN],tg[MAXN],sz[MAXN];void pushup(int u) {if (!u) return;st[u]=st[u<<1]+st[u<<1|1];}50 行未改动```cpp#include<bits/stdc++.h>using namespace std;using ll=long long;using lll=__int128;const ll maxV=1<<20;const ll mod=998244353;bitset<maxV> mp;vector<ll> p;ll fact[maxV],inv_fact[maxV];void init_p() {p.clear();mp.set();mp[0]=mp[1]=0;for (ll i=2;i*i<maxV;i++)if (mp[i])for (ll j=i*i;j<maxV;j+=i)mp[j]=0;for (ll i=2;i<maxV;i++)if (mp[i])p.push_back(i);}ll qpow(ll x,ll alpha) {x%=mod;ll res=1;for (;alpha;alpha>>=1,x=(x*x)%mod) if (alpha&1) res=(x*res)%mod;9 行未改动inv_fact[maxV-1]=inv(fact[maxV-1]);for (int i=maxV-2;i>=0;i--)inv_fact[i]=inv_fact[i+1]*(i+1)%mod;}ll vp(ll x,ll _p) {ll cnt=0;while (x) {x/=_p;cnt+=x;}return cnt;}ll fac(ll x) {if (~fact[x])return fact[x];ll res=1;for (ll _p:p) {if (_p>x)break;res=(res*qpow(_p,vp(x,_p)))%mod;}fact[x]=res;return res;}ll inv_fac(ll x) {if (~inv_fact[x])return inv_fact[x];inv_fact[x]=inv(fac(x));return inv_fact[x];}ll A(ll x,ll y) {if (y<0||y>x) return 0;2 行未改动ll C(ll x,ll y) {if (y<0||y>x) return 0;return fac(x)*inv_fac(y)%mod*inv_fac(x-y)%mod;}void init(bool op=0) {memset(fact,0xff,sizeof fact);memset(inv_fact,0xff,sizeof inv_fact);if (op) init_p();else init_f();}int main() {ios::sync_with_stdio(0);cin.tie(0),cout.tie(0);init();return 0;}```**++RP**2 行未改动34567891059 行未改动707172737475767778798050 行未改动1311321331341351361371381391401419 行未改动1511521531541551561571581591601611622 行未改动1651661671681691701711721731741751761771781792 行未改动```cpp#include<bits/stdc++.h>using namespace std;using ll=long long;int main() {ios::sync_with_stdio(0);cin.tie(0),cout.tie(0);59 行未改动```cpp#include<bits/stdc++.h>using namespace std;using ll=long long;const int maxN=1<<18;int n;ll st[maxN],tg[maxN],sz[maxN];void pushup(int u) {if (!u) return;st[u]=st[u<<1]+st[u<<1|1];}50 行未改动```cpp#include<bits/stdc++.h>using namespace std;using ll=long long;const ll maxV=1<<20;const ll mod=998244353;ll fact[maxV],inv_fact[maxV];ll qpow(ll x,ll alpha) {x%=mod;ll res=1;for (;alpha;alpha>>=1,x=(x*x)%mod) if (alpha&1) res=(x*res)%mod;9 行未改动inv_fact[maxV-1]=inv(fact[maxV-1]);for (int i=maxV-2;i>=0;i--)inv_fact[i]=inv_fact[i+1]*(i+1)%mod;}ll fac(ll x) {return fact[x];}ll inv_fac(ll x) {return inv_fact[x];}ll A(ll x,ll y) {if (y<0||y>x) return 0;2 行未改动ll C(ll x,ll y) {if (y<0||y>x) return 0;return fac(x)*inv_fac(y)%mod*inv_fac(x-y)%mod;}int main() {ios::sync_with_stdio(0);cin.tie(0),cout.tie(0);init_f();return 0;}```**++RP**