That was the way I used to build a centroid tree (a tree that connects all the adjacent centroids during centroid decomposition, used in 342E - Xenia and Tree):
Then I found there were too many for (ll i : e[x]) if (i == pr || vis[i]) continue;s, so I used a macro to do shorten them:
This reduces my code for about 150 bytes. But what I'm worrying now is: will macros increase the difficulty to debug my code, especially in some on-site contests, where templates are not allowed?
I also used #define mid ((lx+rx)>>1) #define l(x) ((x)<<1) #define r(X) (l(x)|1) in segment tree for months btw







