版本比较
模版
正文
增加 5 行删除 49 行
2 行未改动3456787891059 行未改动70717273767778747580767778798050 行未改动1311321331341391351361421431371451461471481491501511521531541551561381391401419 行未改动1511521531541741751761771781791801811551831841561851861871881891901911921571581951961971591601611622 行未改动1651661671682082092102112122131691701712171721731741751761771781792 行未改动```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;const int maxN=1<<18;int n;ll st[MAXN],tg[MAXN],sz[MAXN];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]; 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(); init_f(); return 0;}```
**++RP**