正文
增加 84 行删除 26 行
2 行未改动34567891011121314151617181920212223242526272829303132333435363738394069 行未改动11011111211311411511611711811912012112212312412512612712810 行未改动1391401411422 行未改动```cpp#include <bits/stdc++.h>#define ti chrono::system_clock::now().time_since_epoch().count()#define rep(a,l,r) for(int a=l;a<=r;a++)#define int long long#define pf(x) push_front(x)#define pb(x) push_back(x)#define mkp(x,y) make_pair(x,y)#define PII pair<int,int>#define fir first#define sec second#define ls o<<1#define rs o<<1|1#define lowbit(x) x&(-x)using namespace std;const int INF=1e18;mt19937 gen(ti);uniform_int_distribution<> rnd(1, 1e9);inline int read(){int x=0,f=1;char ch=getchar();while (ch<'0'||ch>'9'){if (ch=='-') f=-1;ch=getchar();}while (ch>='0'&&ch<='9'){x=x*10+ch-48;ch=getchar();}return x*f;}inline void write(int x){if(x<0) putchar('-'),x=-x;if(x>9) write(x/10);putchar(x%10+'0');return ;}signed main(){return 0;}69 行未改动```::::::info[树状数组]```cppstruct BIT{int c[N];void upd(int pos,int v) {for(int i=pos;i<=n;i+=lowbit(i))c[i]+=v;}int qry(int pos) {int res=0;for(int i=pos;i;i-=lowbit(i))res+=c[i];return res;}};```10 行未改动return res;}```:::2 行未改动3456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646569 行未改动13513613713813914014114214314414514614714814915015115215315415515615710 行未改动1681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002 行未改动```cpp#include <bits/stdc++.h>#define ti chrono::system_clock::now().time_since_epoch().count()#define rep(a,l,r) for(int a=l;a<=r;a++)#define req(a,r,l) for(int a=r;a>=l;a--)#define ll long long#define ull unsigned long long#define pf(x) push_front(x)#define pb(x) push_back(x)#define mkp(x,y) make_pair(x,y)#define PII pair<int,int>#define PLL pair<ll,ll>#define fir first#define sec secondusing namespace std;const int INF=1e9;mt19937 gen(ti);uniform_int_distribution<> rnd(1, 1e9);namespace FastIO {template<typename T>inline void read(T &x) {x=0;int f=1;char c=getchar();for(;!isdigit(c);c=getchar()) if(c=='-')f=-1;for(;isdigit(c);c=getchar()) x=(x<<1)+(x<<3)+(c^48);x*=f;}inline void read(char &c) {c=getchar();while(isspace(c)) c=getchar();}inline void read(std::string &s) {s.clear();char c=getchar();for(;isspace(c);c=getchar());for(;!isspace(c)&&c!=EOF;c=getchar()) s+=c;}template<typename T,typename...Args>void read(T &x,Args&...args) {read(x);read(args...);}template<typename T>void print(T x) {if(x<0)x=-x,putchar('-');if(x>9)print(x/10);putchar((x%10)^48);}inline void print(char c) {putchar(c);}inline void print(std::string s) {rep(i,0,(int)s.size())putchar(s[i]);}inline void print(const char*s) {while(*s)putchar(*s++);}template<typename T,typename...Args>void print(const T &x,const Args&...args) {print(x);print(args...);}}using namespace FastIO;int main(){return 0;}69 行未改动```::::::info[树状数组]```cppstruct BIT {#define lowbit(x) x&(-x)int w[N];void upd(int pos,int v) {while(pos<=n) {w[pos]+=v;pos+=lowbit(pos);}}int qry(int pos) {int res=0;while(pos) {res+=w[pos];pos-=lowbit(pos);}return res;}};```10 行未改动return res;}```::::::info[边双连通分量]```cppint tot,dfn[N],low[N];int cnt,bel[N];int st[N],top;vector<int> col[N];void tarjan(int u,int fae) {low[u]=dfn[u]=++tot;st[++top]=u;for(int i=g1.hd[u];i;i=g1.G[i].nxt) {int v=g1.G[i].v,id=g1.G[i].idx;if(!dfn[v]) {tarjan(v,id);low[u]=min(low[u],low[v]);}else if(id!=fae)low[u]=min(low[u],dfn[v]);}if(low[u]==dfn[u]) {cnt++;int x;do {x=st[top--];bel[x]=cnt;col[cnt].pb(x);}while(x!=u);}}```:::