Fork me on GitHub
摘要: 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> 阅读全文
posted @ 2020-01-20 19:53 liusu123456 阅读(153) 评论(4) 推荐(0) 编辑
摘要: #include<iostream> #include<cstring> #include<cstdio> #include<algorithm> #define N 1000 #define M 1000 using namespace std; int time[10]; void get(in 阅读全文
posted @ 2020-01-19 10:53 liusu123456 阅读(117) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2020-01-18 20:52 liusu123456 阅读(86) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> #include<cstring> #include<cstdio> #include<algorithm> #define N 1000 #define M 1000 using namespace std; int n,tot; int a[N]; bool 阅读全文
posted @ 2020-01-18 20:51 liusu123456 阅读(79) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2020-01-18 20:50 liusu123456 阅读(108) 评论(0) 推荐(0) 编辑
摘要: #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 阅读全文
posted @ 2020-01-18 20:48 liusu123456 阅读(83) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2020-01-18 20:46 liusu123456 阅读(81) 评论(0) 推荐(0) 编辑
摘要: #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 阅读全文
posted @ 2020-01-18 20:45 liusu123456 阅读(112) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> #include<cstdio> #include<algorithm> #include<cstring> #define N 1000010 using namespace std; int n,a[N]; void up(int x) { while(x> 阅读全文
posted @ 2020-01-18 20:43 liusu123456 阅读(100) 评论(0) 推荐(0) 编辑