摘要:
int lca(int x,int y) { if(de[x]<de[y]) swap(x,y); int d=de[x]-de[y]; for(int i=log2(d);i>=0;i--) { if(d&(l<<i)) { x=fa[x][i]; } } for(int i=log2(n);i> 阅读全文
摘要:
#include<iostream> #include<cstring> #include<cstdio> #include<algorithm> #define N 1000 #define M 1000 using namespace std; int time[10]; void get(in 阅读全文
摘要:
阅读全文
摘要:
#include<iostream> #include<cstring> #include<cstdio> #include<algorithm> #define N 1000 #define M 1000 using namespace std; int n,tot; int a[N]; bool 阅读全文
摘要:
阅读全文
摘要:
#include<iostream> #include<cstdio> #include<algorithm> #include<cstring> #define N 1000010 using namespace std; int n,m,a[N]; int mx[N*4],mn[N*4]; vo 阅读全文
摘要:
阅读全文
摘要:
#include<iostream> #include<cstring> #include<cstdio> #include<algorithm> #define N 1000 #define M 1000 using namespace std; int n,f; int a[N]; bool c 阅读全文
摘要:
#include<iostream> #include<cstdio> #include<algorithm> #include<cstring> #define N 1000010 using namespace std; int n,a[N]; void up(int x) { while(x> 阅读全文