版本比较
模版
正文
增加 53 行删除 9 行
2 行未改动3456787891046 行未改动5758596061626364656664656667686970717273767778747580767778798045 行未改动1261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781792 行未改动```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); 46 行未改动}```## 随机```cpprandom_device rd;mt19937 gen(rd());ll get_random(ll l,ll r){ random_device rd; mt19937 gen(rd()); uniform_int_distribution<> distrib(l,r); uniform_int_distribution<ll> distrib(l,r); ll dic=distrib(gen); return dic;}```## 线段树```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];}45 行未改动 return 0;}```## 数学类```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; return res;}ll inv(ll x) { return qpow(x,mod-2);}void init_f() { fact[0]=1; for (ll i=1;i<maxV;i++) fact[i]=fact[i-1]*i%mod; 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; return fac(x)*inv_fac(x-y)%mod;}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**