#include<cstdio> #include<algorithm> #define N 50010 #define M 500010 #define rg register #define LL long long using namespace std; int n,m,cnt,root,tot,totnow,totbf; int last[N],size[N],mxsize[N],dep[N],tmp[N],mg[N]; LL ans=; bool v[N]; struc…
Cube number on a tree Time Limit: 20000/10000 MS (Java/Others) Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 1628 Accepted Submission(s): 382 Problem Description The country Tom living in is famous for traveling. Every year, man…