因为是棵树 , 所以直接 dfs 就好了... ------------------------------------------------------------------------------------- #include<cstdio> #include<cstring> #include<algorithm> #include<iostream> #define rep( i , n ) for( int i = 0 ; i <…
不想写. #include<iostream> #include<cstdio> #include<cstring> #include<cstdlib> #include<algorithm> #include<cmath> #include<map> #define pa pair<int,int> #define inf 1000000000 #define ll long long using names…