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
复习一下树的直径,多次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
#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
复习一下scc #include<bits/stdc++.h> using namespace std; const int bw=1000001; int head[bw],head2[bw],low[bw],rd[bw],vist[bw],f[bw],nc[bw],vd[bw],dfn[bw], Read More
lxhgww最近迷上了一款游戏,在游戏里,他拥有很多的装备,每种装备都有2个属性,这些属性的值用[1,10000]之间的数表示。当他使用某种装备时,他只能使用该装备的某一个属性。并且每种装备最多只能使用一次。 游戏进行到最后,lxhgww遇到了终极boss,这个终极boss很奇怪,攻击他的装备所使用 Read More
八中还是清新 比较水的一个并查集二分 #include<bits/stdc++.h> using namespace std; struct node{int a,b,c,d;}num[200000]; int f[200000],n,m,k; int find(int x){if(f[x]==x) Read More