SRM780 Round 1 RestrictedLeaves

URL

https://community.topcoder.com/stat?c=problem_statement&pm=15963&rd=17853

Solución

Calcule \ (dp (v, 0 / 1,0 / 1,0 / 1) \) , tres \ (0/1 \) respectivamente indican si \ (v \) está en IS, la hoja con el DFS más pequeño en el subárbol Ya sea en IS, el más grande está en IS.

La transferencia es \ (O (N) \) .

Lograr

En el camino

Supongo que te gusta

Origin www.cnblogs.com/iefnah06/p/12747416.html
Recomendado
Clasificación