Codeforces Round 748 (Div. 3)---E. Gardener and Tree--深搜变种+贪心+数据结构
#include#definepbpush_back#defineYEScout>n>>k;queuee;vectorq[n+10],dep(n+10),vis(n+10),j(n+10);llx,y;for(lli=1;i>x>>y;q[x].push_back(y);q[y].push_back(x);vis[x]++;vis[y]++;}for(lli=1;i>t;while(t--)sol