正文
增加 29 行删除 29 行
39 行未改动4041424344454647484 行未改动53545556575859606162636465666768697071727384 行未改动15815916016116216316416516675 行未改动24224324424524624724824925093 行未改动344345346347348349350351352146 行未改动全部展开499500501502503504505506507112 行未改动全部展开62062162262362462562662762840 行未改动66967067167267367467567667767867968068168268368468568668768868969069159 行未改动751752753754755756757758759145 行未改动全部展开90590690790890991091191291311 行未改动92592692792892993093193293393493593693793893994094194210 行未改动9539549559569579589599609615 行未改动967968969970971972973974975976977978979980981982983984985986987988989103 行未改动全部展开10931094109510961097109810991100110112 行未改动11141115111611171118111911201121112292 行未改动12151216121712181219122012211222122312 行未改动123612371238123912401241124212431244262 行未改动全部展开15071508150915101511151215131514151573 行未改动15891590159115921593159415951596159748 行未改动164616471648164916501651165216531654162 行未改动全部展开18171818181918201821182218231824182545 行未改动187118721873187418751876187718781879115 行未改动全部展开39 行未改动inline void read(int &x) {x=0;char ch=getchar();while (ch<48) ch=getchar();while (ch>=48) x=(x<<3)+(x<<1)+(ch^48),ch=getchar();}int n,m,k;4 行未改动int from[N],vis[N];ll dis[N];int head[N],tot;struct Edge{int next,to,w;}e[M];inline void add(int u,int v,int w) {e[++tot]={head[u],v,w};head[u]=tot;}struct Node {int id;ll val;inline bool operator <(const Node &a)const {return val>a.val;}};priority_queue<Node> q;inline void dij() {f(i,1,n) dis[i]=inf,vis[i]=0;f(i,1,k) {dis[id[i]]=0,q.push({id[i],0});84 行未改动inline void read(int &x) {x=0;char ch=getchar();while (ch<48) ch=getchar();while (ch>=48) x=(x<<3)+(x<<1)+(ch^48),ch=getchar();}int n,m,C;75 行未改动inline void read(int &x) {x=0;char ch=getchar();while (ch<48) ch=getchar();while (ch>=48) x=(x<<3)+(x<<1)+(ch^48),ch=getchar();}int n,m,k,tot;93 行未改动inline void read(int &x) {x=0;char ch=getchar();while (ch<48) ch=getchar();while (ch>=48) x=(x<<3)+(x<<1)+(ch^48),ch=getchar();}int n,m,tot;146 行未改动全部展开inline void read(int &x) {x=0;char ch=getchar();while (ch<48) ch=getchar();while (ch>=48) x=(x<<3)+(x<<1)+(ch^48),ch=getchar();}int n,m,q,cnt;112 行未改动全部展开inline void read(int &x) {x=0;char ch=getchar();while (ch<48) ch=getchar();while (ch>=48) x=(x<<3)+(x<<1)+(ch^48),ch=getchar();}int n,m,q,cnt,idx;40 行未改动int tot;struct Node{int ls,rs,sum;}tr[N<<5];#define ls(x) tr[x].ls#define rs(x) tr[x].rsinline int newNode(int x) {tr[++tot]=tr[x];tr[tot].sum++;return tot;}inline void update(int &now,int x,int l,int r) {now=newNode(now);if (l==r) return;int mid=l+r>>1;if (x<=mid) update(ls(now),x,l,mid);else update(rs(now),x,mid+1,r);}inline int query(int r1,int r2,int l,int r,int k) {if (k>tr[r2].sum-tr[r1].sum) return -1;if (l==r) return l;int mid=l+r>>1,res=tr[rs(r2)].sum-tr[rs(r1)].sum;59 行未改动inline void read(int &x) {x=0;char ch=getchar();while (ch<48) ch=getchar();while (ch>=48) x=(x<<3)+(x<<1)+(ch^48),ch=getchar();}int n,m,cnt;145 行未改动全部展开inline void read(int &x) {x=0;char ch=getchar();while (ch<48) ch=getchar();while (ch>=48) x=(x<<3)+(x<<1)+(ch^48),ch=getchar();}int n,m,q;11 行未改动struct Graph {int cnt,tot;int L[N],R[N],val[N],dfn[N],f[N][21];vector<int> e[N];inline void dfs(int now,int fa) {f[now][0]=fa;f(i,1,19) f[now][i]=f[f[now][i-1]][i-1];L[now]=tot+1;if (now<=n) dfn[++tot]=now;for (int v:e[now]) dfs(v,now);R[now]=tot;}inline void kruskal(int op) {f(i,1,m) {if (op==1) p[i].w=max(p[i].u,p[i].v);if (op==2) p[i].w=min(p[i].u,p[i].v);10 行未改动e[cnt].push_back(v);}dfs(cnt,0);}inline void update(int &now,int T,int op) {if (op==1) {F(i,19,0) if (f[now][i]&&val[f[now][i]]<=T) now=f[now][i];}if (op==2) {F(i,19,0) if (f[now][i]&&val[f[now][i]]>=T) now=f[now][i];}}5 行未改动int tot;struct Node{int sum,ls,rs;}tr[N<<5];#define ls(x) tr[x].ls#define rs(x) tr[x].rsinline int newNode(int x) {tr[++tot]=tr[x];tr[tot].sum++;return tot;}inline void update(int &now,int x,int l,int r) {now=newNode(now);if (l==r) return;int mid=l+r>>1;if (x<=mid) update(ls(now),x,l,mid);else update(rs(now),x,mid+1,r);}inline int query(int r1,int r2,int x,int y,int l,int r) {if (x<=l&&y>=r) return tr[r2].sum-tr[r1].sum;int mid=l+r>>1,res=0;if (x<=mid) res=query(ls(r1),ls(r2),x,y,l,mid);103 行未改动全部展开inline void read(int &x) {x=0;char ch=getchar();while (ch<48) ch=getchar();while (ch>=48) x=(x<<3)+(x<<1)+(ch^48),ch=getchar();}mt19937 Ff(time(0));12 行未改动int vis[N],did[N];inline void dfs1(int now) {did[now]=1;for (Node x:e[now]) if (!did[x.to])dfs1(x.to),vis[x.id]=1;}inline void dfs2(int now) {92 行未改动inline void read(int &x) {x=0;char ch=getchar();while (ch<48) ch=getchar();while (ch>=48) x=(x<<3)+(x<<1)+(ch^48),ch=getchar();}mt19937 Ff(time(0));12 行未改动int did[N],vis[N];inline void dfs1(int now) {did[now]=1;for (Edge E:e[now]) if (!did[E.v])dfs1(E.v),vis[E.id]=1;}ull val[N],pt[N];262 行未改动全部展开inline int abs(int x) {return x<0?-x:x;}inline void read(int &x) {x=0;char ch=getchar();while (ch<48) ch=getchar();while (ch>=48) x=(x<<3)+(x<<1)+(ch^48),ch=getchar();}int n,m;73 行未改动}f(i,1,n) f(j,1,m) if (mp[i][j]=='#') {for (int x=max(i-2,1);x<=min(i+2,n);x++) {int d=2-abs(x-i);for (int y=max(j-d,1);y<=min(j+d,m);y++)if (mp[x][y]=='#'&&(i!=x||j!=y)) add(ou[i][j],in[x][y],inf);}}printf("%d\n",ek());48 行未改动inline void read(int &x) {x=0;char ch=getchar();while (ch<48) ch=getchar();while (ch>=48) x=(x<<3)+(x<<1)+(ch^48),ch=getchar();}int n;162 行未改动全部展开inline void read(int &x) {x=0;char ch=getchar();while (ch<48) ch=getchar();while (ch>=48) x=(x<<3)+(x<<1)+(ch^48),ch=getchar();}struct Ctrl_Z_Array {45 行未改动if (!lst[w[now]+1]) mx_to[now]=w[now];else mx_to[now]=mx_to[lst[w[now]+1]];lst.update(w[now],now);if (w[now]==1) mx=max(mx,mx_to[now]);}mx_res[now]=mx;for (int v:e[now]) if (v!=fa&&!del[v]) c_res(v,now,mx);if (w[now]!=-1) lst.remove();}115 行未改动全部展开39 行未改动4041424344454647484 行未改动53545556575859606162636465666768697071727384 行未改动15815916016116216316416516675 行未改动24224324424524624724824925093 行未改动344345346347348349350351352146 行未改动全部展开499500501502503504505506507112 行未改动全部展开62062162262362462562662762840 行未改动66967067167267367467567667767867968068168268368468568668768868969069159 行未改动751752753754755756757758759145 行未改动全部展开90590690790890991091191291311 行未改动92592692792892993093193293393493593693793893994094194210 行未改动9539549559569579589599609615 行未改动967968969970971972973974975976977978979980981982983984985986987988989103 行未改动全部展开10931094109510961097109810991100110112 行未改动11141115111611171118111911201121112292 行未改动12151216121712181219122012211222122312 行未改动123612371238123912401241124212431244262 行未改动全部展开15071508150915101511151215131514151573 行未改动15891590159115921593159415951596159748 行未改动164616471648164916501651165216531654162 行未改动全部展开18171818181918201821182218231824182545 行未改动187118721873187418751876187718781879115 行未改动全部展开39 行未改动inline void read(int &x) {x=0;char ch=getchar();while (ch<48) ch=getchar();while (ch>=48) x=(x<<3)+(x<<1)+(ch^48),ch=getchar();}int n,m,k;4 行未改动int from[N],vis[N];ll dis[N];int head[N],tot;struct Edge{int next,to,w;}e[M];inline void add(int u,int v,int w) {e[++tot]={head[u],v,w};head[u]=tot;}struct Node {int id;ll val;inline bool operator <(const Node &a)const {return val>a.val;}};priority_queue<Node> q;inline void dij() {f(i,1,n) dis[i]=inf,vis[i]=0;f(i,1,k) {dis[id[i]]=0,q.push({id[i],0});84 行未改动inline void read(int &x) {x=0;char ch=getchar();while (ch<48) ch=getchar();while (ch>=48) x=(x<<3)+(x<<1)+(ch^48),ch=getchar();}int n,m,C;75 行未改动inline void read(int &x) {x=0;char ch=getchar();while (ch<48) ch=getchar();while (ch>=48) x=(x<<3)+(x<<1)+(ch^48),ch=getchar();}int n,m,k,tot;93 行未改动inline void read(int &x) {x=0;char ch=getchar();while (ch<48) ch=getchar();while (ch>=48) x=(x<<3)+(x<<1)+(ch^48),ch=getchar();}int n,m,tot;146 行未改动全部展开inline void read(int &x) {x=0;char ch=getchar();while (ch<48) ch=getchar();while (ch>=48) x=(x<<3)+(x<<1)+(ch^48),ch=getchar();}int n,m,q,cnt;112 行未改动全部展开inline void read(int &x) {x=0;char ch=getchar();while (ch<48) ch=getchar();while (ch>=48) x=(x<<3)+(x<<1)+(ch^48),ch=getchar();}int n,m,q,cnt,idx;40 行未改动int tot;struct Node{int ls,rs,sum;}tr[N<<5];#define ls(x) tr[x].ls#define rs(x) tr[x].rsinline int newNode(int x) {tr[++tot]=tr[x];tr[tot].sum++;return tot;}inline void update(int &now,int x,int l,int r) {now=newNode(now);if (l==r) return;int mid=l+r>>1;if (x<=mid) update(ls(now),x,l,mid);else update(rs(now),x,mid+1,r);}inline int query(int r1,int r2,int l,int r,int k) {if (k>tr[r2].sum-tr[r1].sum) return -1;if (l==r) return l;int mid=l+r>>1,res=tr[rs(r2)].sum-tr[rs(r1)].sum;59 行未改动inline void read(int &x) {x=0;char ch=getchar();while (ch<48) ch=getchar();while (ch>=48) x=(x<<3)+(x<<1)+(ch^48),ch=getchar();}int n,m,cnt;145 行未改动全部展开inline void read(int &x) {x=0;char ch=getchar();while (ch<48) ch=getchar();while (ch>=48) x=(x<<3)+(x<<1)+(ch^48),ch=getchar();}int n,m,q;11 行未改动struct Graph {int cnt,tot;int L[N],R[N],val[N],dfn[N],f[N][21];vector<int> e[N];inline void dfs(int now,int fa) {f[now][0]=fa;f(i,1,19) f[now][i]=f[f[now][i-1]][i-1];L[now]=tot+1;if (now<=n) dfn[++tot]=now;for (int v:e[now]) dfs(v,now);R[now]=tot;}inline void kruskal(int op) {f(i,1,m) {if (op==1) p[i].w=max(p[i].u,p[i].v);if (op==2) p[i].w=min(p[i].u,p[i].v);10 行未改动e[cnt].push_back(v);}dfs(cnt,0);}inline void update(int &now,int T,int op) {if (op==1) {F(i,19,0) if (f[now][i]&&val[f[now][i]]<=T) now=f[now][i];}if (op==2) {F(i,19,0) if (f[now][i]&&val[f[now][i]]>=T) now=f[now][i];}}5 行未改动int tot;struct Node{int sum,ls,rs;}tr[N<<5];#define ls(x) tr[x].ls#define rs(x) tr[x].rsinline int newNode(int x) {tr[++tot]=tr[x];tr[tot].sum++;return tot;}inline void update(int &now,int x,int l,int r) {now=newNode(now);if (l==r) return;int mid=l+r>>1;if (x<=mid) update(ls(now),x,l,mid);else update(rs(now),x,mid+1,r);}inline int query(int r1,int r2,int x,int y,int l,int r) {if (x<=l&&y>=r) return tr[r2].sum-tr[r1].sum;int mid=l+r>>1,res=0;if (x<=mid) res=query(ls(r1),ls(r2),x,y,l,mid);103 行未改动全部展开inline void read(int &x) {x=0;char ch=getchar();while (ch<48) ch=getchar();while (ch>=48) x=(x<<3)+(x<<1)+(ch^48),ch=getchar();}mt19937 Ff(time(0));12 行未改动int vis[N],did[N];inline void dfs1(int now) {did[now]=1;for (Node x:e[now]) if (!did[x.to])dfs1(x.to),vis[x.id]=1;}inline void dfs2(int now) {92 行未改动inline void read(int &x) {x=0;char ch=getchar();while (ch<48) ch=getchar();while (ch>=48) x=(x<<3)+(x<<1)+(ch^48),ch=getchar();}mt19937 Ff(time(0));12 行未改动int did[N],vis[N];inline void dfs1(int now) {did[now]=1;for (Edge E:e[now]) if (!did[E.v])dfs1(E.v),vis[E.id]=1;}ull val[N],pt[N];262 行未改动全部展开inline int abs(int x) {return x<0?-x:x;}inline void read(int &x) {x=0;char ch=getchar();while (ch<48) ch=getchar();while (ch>=48) x=(x<<3)+(x<<1)+(ch^48),ch=getchar();}int n,m;73 行未改动}f(i,1,n) f(j,1,m) if (mp[i][j]=='#') {for (int x=max(i-2,1);x<=min(i+2,n);x++) {int d=2-abs(x-i);for (int y=max(j-d,1);y<=min(j+d,m);y++)if (mp[x][y]=='#'&&(i!=x||j!=y)) add(ou[i][j],in[x][y],inf);}}printf("%d\n",ek());48 行未改动inline void read(int &x) {x=0;char ch=getchar();while (ch<48) ch=getchar();while (ch>=48) x=(x<<3)+(x<<1)+(ch^48),ch=getchar();}int n;162 行未改动全部展开inline void read(int &x) {x=0;char ch=getchar();while (ch<48) ch=getchar();while (ch>=48) x=(x<<3)+(x<<1)+(ch^48),ch=getchar();}struct Ctrl_Z_Array {45 行未改动if (!lst[w[now]+1]) mx_to[now]=w[now];else mx_to[now]=mx_to[lst[w[now]+1]];lst.update(w[now],now);if (w[now]==1) mx=max(mx,mx_to[now]);}mx_res[now]=mx;for (int v:e[now]) if (v!=fa&&!del[v]) c_res(v,now,mx);if (w[now]!=-1) lst.remove();}115 行未改动全部展开