CF - Ostap & Tree
Author: Benjamin Qi
Solution described by editorial is terrible, but we can do better! This runs in time. (proof?)
vmi yes[MX], no[MX];vi adj[MX];int n,k;void dfs(int x, int y) {yes[x] = no[x] = {1}; // black, not black// dist of closest good vertex// or dist of farthest bad vertexauto ad = [](vmi& a, int b, mi c) {while (sz(a) <= b) a.pb(0);