欢迎来到SFWR的博客

LCA倍增+大眼观察 #include<bits/stdc++.h> using namespace std; int n,m,a,b,ne,c,head[1001000],fa[501000][26],d[501000]; struct node{int nxt,v;}eg[1001000]; v Read More
posted @ 2019-11-14 11:20 SFWR Views(77) Comments(0) Diggs(0) Edit
复习一下树的直径,多次dfs求解 #include<bits/stdc++.h> using namespace std; int n,m,a,b,ne,c,tpo=1,tp=1,head[405000]; long long ans,d[205000][2],dl[205000]; struct Read More
posted @ 2019-11-14 09:36 SFWR Views(75) Comments(0) Diggs(0) Edit
#include<bits/stdc++.h> using namespace std; int n,m,a,b,c,ne,tot,head[100008*30],ch[100008*30][3];long long val[100008*30],ans=-1; struct node{int nx Read More
posted @ 2019-11-14 07:01 SFWR Views(120) Comments(0) Diggs(0) Edit