这里会显示出您选择的修订版和当前版本之间的差别。
| 两侧同时换到之前的修订记录 前一修订版 后一修订版 | 前一修订版 | ||
|
2020-2021:teams:legal_string:jxm2001:静态点分治 [2020/06/10 16:53] jxm2001 |
2020-2021:teams:legal_string:jxm2001:静态点分治 [2020/07/26 15:53] (当前版本) jxm2001 ↷ 页面2020-2021:teams:legal_string:静态点分治被移动至2020-2021:teams:legal_string:jxm2001:静态点分治 |
||
|---|---|---|---|
| 行 52: | 行 52: | ||
| if(vis[v]) | if(vis[v]) | ||
| continue; | continue; | ||
| - | tot_sz=sz[v]>sz[u]?cur_sz-sz[u]:sz[v];root_sz=inf; | + | tot_sz=sz[v]>sz[u]?cur_sz-sz[u]:sz[v];root_sz=MAXN; |
| find_root(v,u); | find_root(v,u); | ||
| solve(root); | solve(root); | ||
| 行 85: | 行 85: | ||
| <hidden 代码> | <hidden 代码> | ||
| <code cpp> | <code cpp> | ||
| - | #include <cstdio> | ||
| - | #include <cctype> | ||
| - | #include <vector> | ||
| - | #define _for(i,a,b) for(int i=(a);i<(b);++i) | ||
| - | using namespace std; | ||
| - | inline int read_int(){ | ||
| - | int t=0;bool sign=false;char c=getchar(); | ||
| - | while(!isdigit(c)){sign|=c=='-';c=getchar();} | ||
| - | while(isdigit(c)){t=(t<<1)+(t<<3)+(c&15);c=getchar();} | ||
| - | return sign?-t:t; | ||
| - | } | ||
| const int MAXN=1e4+5,inf=1e7+5; | const int MAXN=1e4+5,inf=1e7+5; | ||
| struct Edge{ | struct Edge{ | ||
| 行 170: | 行 159: | ||
| if(vis[v]) | if(vis[v]) | ||
| continue; | continue; | ||
| - | tot_sz=sz[v]>sz[u]?cur_sz-sz[u]:sz[v];root_sz=inf; | + | tot_sz=sz[v]>sz[u]?cur_sz-sz[u]:sz[v];root_sz=MAXN; |
| find_root(v,u); | find_root(v,u); | ||
| solve(root); | solve(root); | ||
| 行 212: | 行 201: | ||
| <hidden 代码> | <hidden 代码> | ||
| <code cpp> | <code cpp> | ||
| - | #include <cstdio> | ||
| - | #include <cctype> | ||
| - | #include <vector> | ||
| - | #define _for(i,a,b) for(int i=(a);i<(b);++i) | ||
| - | using namespace std; | ||
| - | inline int read_int(){ | ||
| - | int t=0;bool sign=false;char c=getchar(); | ||
| - | while(!isdigit(c)){sign|=c=='-';c=getchar();} | ||
| - | while(isdigit(c)){t=(t<<1)+(t<<3)+(c&15);c=getchar();} | ||
| - | return sign?-t:t; | ||
| - | } | ||
| const int MAXN=2e5+5,inf=1e6+5; | const int MAXN=2e5+5,inf=1e6+5; | ||
| struct Edge{ | struct Edge{ | ||
| 行 376: | 行 354: | ||
| <hidden 代码> | <hidden 代码> | ||
| <code cpp> | <code cpp> | ||
| - | #include <cstdio> | ||
| - | #include <cctype> | ||
| - | #include <vector> | ||
| - | #define _for(i,a,b) for(int i=(a);i<(b);++i) | ||
| - | using namespace std; | ||
| - | typedef long long LL; | ||
| - | inline int read_int(){ | ||
| - | int t=0;bool sign=false;char c=getchar(); | ||
| - | while(!isdigit(c)){sign|=c=='-';c=getchar();} | ||
| - | while(isdigit(c)){t=(t<<1)+(t<<3)+(c&15);c=getchar();} | ||
| - | return sign?-t:t; | ||
| - | } | ||
| - | inline void write(LL x){ | ||
| - | register char c[21],len=0; | ||
| - | if(!x)return putchar('0'),void(); | ||
| - | if(x<0)x=-x,putchar('-'); | ||
| - | while(x)c[++len]=x%10,x/=10; | ||
| - | while(len)putchar(c[len--]+48); | ||
| - | } | ||
| - | inline void space(LL x){write(x),putchar(' ');} | ||
| - | inline void enter(LL x){write(x),putchar('\n');} | ||
| const int MAXN=1e5+5; | const int MAXN=1e5+5; | ||
| struct Edge{ | struct Edge{ | ||